12 Mar
2020
12 Mar
'20
1:08 a.m.
On Wed, Mar 11, 2020 at 10:09 AM Serhiy Storchaka
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