summaryrefslogtreecommitdiff
path: root/numpy/lib/tests/test_function_base.py
diff options
context:
space:
mode:
authorMichael Goerz <goerz@stanford.edu>2016-08-15 00:31:43 -0400
committerMichael Goerz <goerz@stanford.edu>2016-08-15 00:31:43 -0400
commit60b3727e6937891a9b91bac4ffb097bb3b5bd25d (patch)
treea04f39ee547c8b88dfbdffeb7a157a08b4e7113d /numpy/lib/tests/test_function_base.py
parente1f191c46f2eebd6cb892a4bfe14d9dd43a06c4e (diff)
downloadnumpy-60b3727e6937891a9b91bac4ffb097bb3b5bd25d.tar.gz
ENH: improve duck typing inside iscomplexobj
Both `iscomplexobj` and `isrealobj` now try to refer to the argument's `dtype` attribute if it exists. This significantly extends the list of types for which `iscomplexobj` returns correct results (including e.g. scipy sparse matrices and pandas objects). Extended the tests of the `iscomplexobj` routine for the following cases: * simple scalars * standard lists (test internal auto-conversion to numpy arrays) * "Duck typing" for objects that define a dtype attribute (either referring to one of the existing numpy dtypes, or a custom dtype, as pandas does) This fixes #7924
Diffstat (limited to 'numpy/lib/tests/test_function_base.py')
0 files changed, 0 insertions, 0 deletions