diff options
author | Michael Goerz <goerz@stanford.edu> | 2016-08-15 00:31:43 -0400 |
---|---|---|
committer | Michael Goerz <goerz@stanford.edu> | 2016-08-15 00:31:43 -0400 |
commit | 60b3727e6937891a9b91bac4ffb097bb3b5bd25d (patch) | |
tree | a04f39ee547c8b88dfbdffeb7a157a08b4e7113d /numpy/lib/arraysetops.py | |
parent | e1f191c46f2eebd6cb892a4bfe14d9dd43a06c4e (diff) | |
download | numpy-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/arraysetops.py')
0 files changed, 0 insertions, 0 deletions