summaryrefslogtreecommitdiff
path: root/numpy/lib/stride_tricks.py
diff options
context:
space:
mode:
authorStephan Hoyer <shoyer@climate.com>2015-03-01 14:23:07 -0800
committerStephan Hoyer <shoyer@climate.com>2015-03-01 14:29:58 -0800
commitd5a67b5b421c12cc46d9bcd07ddc4b91c1e5fef3 (patch)
tree8f4c8c15dbebbd8bcba9406eeee9e2a2f6ead462 /numpy/lib/stride_tricks.py
parent50e4eb87370b77792f1f6d21a5edd6ff20abee68 (diff)
downloadnumpy-d5a67b5b421c12cc46d9bcd07ddc4b91c1e5fef3.tar.gz
BUG: fix broadcast_to for reference types
Diffstat (limited to 'numpy/lib/stride_tricks.py')
-rw-r--r--numpy/lib/stride_tricks.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/numpy/lib/stride_tricks.py b/numpy/lib/stride_tricks.py
index 0f46ed335..a5f247abf 100644
--- a/numpy/lib/stride_tricks.py
+++ b/numpy/lib/stride_tricks.py
@@ -60,9 +60,9 @@ def _broadcast_to(array, shape, subok, readonly):
if any(size < 0 for size in shape):
raise ValueError('all elements of broadcast shape must be non-'
'negative')
- broadcast = np.nditer((array,), flags=['multi_index', 'zerosize_ok'],
- op_flags=['readonly'], itershape=shape, order='C'
- ).itviews[0]
+ broadcast = np.nditer(
+ (array,), flags=['multi_index', 'refs_ok', 'zerosize_ok'],
+ op_flags=['readonly'], itershape=shape, order='C').itviews[0]
result = _maybe_view_as_subclass(array, broadcast)
if not readonly and array.flags.writeable:
result.flags.writeable = True