From 00640218fcbc5d71f22550a9368da92358c8de96 Mon Sep 17 00:00:00 2001 From: Stephan Hoyer Date: Sun, 28 Oct 2018 14:55:54 -0700 Subject: MAINT: adjust stack deprecation warning per review --- numpy/core/shape_base.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'numpy/core/shape_base.py') 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 -- cgit v1.2.1