summaryrefslogtreecommitdiff
path: root/numpy/core/shape_base.py
diff options
context:
space:
mode:
authorStephan Hoyer <shoyer@google.com>2018-10-28 14:55:54 -0700
committerStephan Hoyer <shoyer@google.com>2018-10-28 14:58:48 -0700
commit00640218fcbc5d71f22550a9368da92358c8de96 (patch)
treef6a56f8afd6689ba6eca459444ac4910ea3e13a8 /numpy/core/shape_base.py
parentc4f853968c862849f159bad5c187310c1aa93e56 (diff)
downloadnumpy-00640218fcbc5d71f22550a9368da92358c8de96.tar.gz
MAINT: adjust stack deprecation warning per review
Diffstat (limited to 'numpy/core/shape_base.py')
-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