summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
Diffstat (limited to 'numpy')
-rw-r--r--numpy/core/memmap.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/numpy/core/memmap.py b/numpy/core/memmap.py
index 3bd22dc9f..f5cab4476 100644
--- a/numpy/core/memmap.py
+++ b/numpy/core/memmap.py
@@ -240,8 +240,7 @@ class memmap(ndarray):
else:
if not isinstance(shape, tuple):
shape = (shape,)
- shape = tuple(map(lambda x: np.intp(x), shape)) # Force-promote to intp, prevent possible overflow with 32-bit types near the top of their range
- size = 1
+ size = np.intp(1) # Causes bytes below to be computed as largest integer type available to prevent overflow
for k in shape:
size *= k