diff options
author | Stephan Hoyer <shoyer@google.com> | 2018-10-28 14:55:54 -0700 |
---|---|---|
committer | Stephan Hoyer <shoyer@google.com> | 2018-10-28 14:58:48 -0700 |
commit | 00640218fcbc5d71f22550a9368da92358c8de96 (patch) | |
tree | f6a56f8afd6689ba6eca459444ac4910ea3e13a8 /numpy/core/shape_base.py | |
parent | c4f853968c862849f159bad5c187310c1aa93e56 (diff) | |
download | numpy-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.py | 11 |
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 |