diff options
author | k_kapp@yahoo.com <k_kapp@yahoo.com> | 2017-05-24 02:25:02 +0200 |
---|---|---|
committer | k_kapp@yahoo.com <k_kapp@yahoo.com> | 2017-05-24 02:28:51 +0200 |
commit | af07eae470280f7f1d2c0e3963c553ae0a796a35 (patch) | |
tree | d09c42284f4af6667fa3fea6a5d49103b5e3b844 /numpy/ma | |
parent | d0c15fab8e3c0324914baede7496810485eb4e56 (diff) | |
download | numpy-af07eae470280f7f1d2c0e3963c553ae0a796a35.tar.gz |
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.
Diffstat (limited to 'numpy/ma')
-rw-r--r-- | numpy/ma/core.py | 2 |
1 files changed, 1 insertions, 1 deletions
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 |