summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
Diffstat (limited to 'numpy')
-rw-r--r--numpy/core/shape_base.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/numpy/core/shape_base.py b/numpy/core/shape_base.py
index 22ce47162..3edf0824e 100644
--- a/numpy/core/shape_base.py
+++ b/numpy/core/shape_base.py
@@ -207,12 +207,11 @@ def atleast_3d(*arys):
def _arrays_for_stack_dispatcher(arrays, stacklevel=4):
- if hasattr(arrays, '__iter__') and not hasattr(arrays, '__getitem__'):
- warnings.warn('arrays to stack must be passed as a sequence. Support '
- 'for non-sequence iterables is deprecated as of '
- 'NumPy 1.16 and will raise an error in the future. '
- 'Note also that dispatch with __array_function__ is not '
- 'supported when arrays are not provided as a sequence.',
+ if not hasattr(arrays, '__getitem__') and hasattr(arrays, '__iter__'):
+ warnings.warn('arrays to stack must be passed as a "sequence" type '
+ 'such as list or tuple. Support for non-sequence '
+ 'iterables such as generators is deprecated as of '
+ 'NumPy 1.16 and will raise an error in the future.',
FutureWarning, stacklevel=stacklevel)
return ()
return arrays