You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following code fails with numpy 1.12.0 (this is the only version we have tested).
>>> arr = np.array([], dtype=object)
>>> copy.deepcopy(arr)
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/IPython/core/interactiveshell.py", line 2821, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-16-e314fe8a32a6>", line 1, in <module>
copy.deepcopy(arr)
File "/usr/lib/python3.4/copy.py", line 166, in deepcopy
y = copier(memo)
ValueError: Iteration of zero-sized operands is not enabled
Note that this code already works if the dtype was not object but, e.g., int or str.
The text was updated successfully, but these errors were encountered:
The error is the new iterator missing the zerosize ok flag, a bit annoying really since you usually want it.... It is gh-8125. CC @pelson in case you have time/want to fix it up.
The flag already exists. Though since you have to test for an empty iterator afterwards then, could just as well test before the iterator here probably, since its a single array there is no complexity there.
The following code fails with numpy 1.12.0 (this is the only version we have tested).
Note that this code already works if the dtype was not object but, e.g., int or str.
The text was updated successfully, but these errors were encountered: