On Wed, Mar 11, 2020 at 10:09 AM Serhiy Storchaka <storch...@gmail.com> 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 -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/XOWADGIUQERVNMMUPQPH6YLKXGRMGJSW/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to