[Numpy-discussion] Why are empty arrays False?

Marten van Kerkwijk m.h.vankerkwijk at gmail.com
Sat Aug 19 18:05:50 EDT 2017


Agreed with Eric Wieser here have an empty array test as `False` is
less than useless, since a non-empty array either returns something
based on its contents or an error. This means that one cannot write
statements like `if array:`. Does this leave any use case? It seems to
me it just shows there is no point in defining the truthiness of an
empty array.
-- Marten


More information about the NumPy-Discussion mailing list