From 4bed228adba88f9c5b85eaad308582db79a95b7b Mon Sep 17 00:00:00 2001 From: Eric Wieser Date: Sun, 8 Jul 2018 17:38:33 +0100 Subject: MAINT: Restore previous behavior on subclasses --- numpy/core/numeric.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'numpy/core/numeric.py') diff --git a/numpy/core/numeric.py b/numpy/core/numeric.py index a9fa3efe0..e5570791a 100644 --- a/numpy/core/numeric.py +++ b/numpy/core/numeric.py @@ -1509,8 +1509,8 @@ def normalize_axis_tuple(axis, ndim, argname=None, allow_duplicate=False): -------- normalize_axis_index : normalizing a single scalar axis """ - # Speed-up most common cases. - if not isinstance(axis, (list, tuple)): + # Optimization to speed-up the most common cases. + if type(axis) not in (tuple, list): try: axis = [operator.index(axis)] except TypeError: -- cgit v1.2.1