From af07eae470280f7f1d2c0e3963c553ae0a796a35 Mon Sep 17 00:00:00 2001 From: "k_kapp@yahoo.com" Date: Wed, 24 May 2017 02:25:02 +0200 Subject: MAINT: Simplify if statement isinstance(obj, ndarray) will return False if (obj is None) in any case, so no need to check whether (obj is not None) before it. All tests pass on my build (the most recent one at the time making this PR). However, this might have been done for backward compatibility. Will see how the CI tests do. --- numpy/ma/core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'numpy/ma') diff --git a/numpy/ma/core.py b/numpy/ma/core.py index d6b30ae2e..d9401fa1d 100644 --- a/numpy/ma/core.py +++ b/numpy/ma/core.py @@ -2935,7 +2935,7 @@ class MaskedArray(ndarray): Copies some attributes of obj to self. """ - if obj is not None and isinstance(obj, ndarray): + if isinstance(obj, ndarray): _baseclass = type(obj) else: _baseclass = ndarray -- cgit v1.2.1