summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
authorPat Gunn <pgunn01@gmail.com>2018-06-03 01:14:45 -0400
committerPat Gunn <pgunn01@gmail.com>2018-06-03 01:14:45 -0400
commitf09949188eb7bbc8b5e33c3f9ee7c58bf7767c69 (patch)
tree0dccd2289218a0e9f2fca83e7356cb095f7251e4 /numpy
parent75b7d2234d58aa590ae0b3bdd432836d55b0550c (diff)
downloadnumpy-f09949188eb7bbc8b5e33c3f9ee7c58bf7767c69.tar.gz
Revise further as per peer review
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