diff options
author | Jim Crist <crist042@umn.edu> | 2016-11-15 15:28:12 -0600 |
---|---|---|
committer | Jim Crist <crist042@umn.edu> | 2017-01-23 12:21:18 -0600 |
commit | 6cbb46e45dde71be76ec6c3f4e8e6fccb4227976 (patch) | |
tree | 2bb3621c4b73895476f2347743d8d25134cb116b /numpy/core/fromnumeric.py | |
parent | 1c8ecc783c43269631b1fdc8f9e06355d231aec6 (diff) | |
download | numpy-6cbb46e45dde71be76ec6c3f4e8e6fccb4227976.tar.gz |
BUG: bool(dtype) is True
Previously `bool(dtype(...))` would fallback to the default
implementation of `__nonzero__`, which checks if `len(object) > 0`.
Since `dtype` objects implement `__len__` as the number of record
fields, `bool` of scalar dtypes like `bool(dtype('i8'))` would evaluate
as `False`. This fixes that by implementing `__nonzero__` to always
return True.
Fixes #6294.
Diffstat (limited to 'numpy/core/fromnumeric.py')
0 files changed, 0 insertions, 0 deletions