On Wed, Mar 11, 2020 at 10:09 AM Serhiy Storchaka <[email protected]> wrote:
> There is a precedence (although not in the stdlib): NumPy array with
> dtype=bool.
>
> >>> import numpy
> >>> bool(numpy.array([False, False]))
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> ValueError: The truth value of an array with more than one element is
> ambiguous. Use a.any() or a.all()
There are some cases in the standard library, e.g.
>>> import dbm.dumb
>>> db = dbm.dumb.open('foo')
>>> db.close()
>>> not db
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OSError: DBM object has already been closed
mmap.mmap also does this. Maybe it's a bug, or maybe the objects are
considered to be invalid and no longer fit for any use.
-- Ben
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/[email protected]/message/XOWADGIUQERVNMMUPQPH6YLKXGRMGJSW/
Code of Conduct: http://python.org/psf/codeofconduct/