[Numpy-discussion] "False" and "True" not singletons?
Tue Dec 30 15:33:52 CST 2008
On Tue, Dec 30, 2008 at 14:59, Christopher Barker <Chris.Barker@noaa.gov> wrote:
> Hi all,
> I've just discovered that "False" is not a singleton:
> >>> import numpy as N
> >>> f = N.all((1,2,0))
> >>> print f
> >>> id(f)
> >>> f is False
> >>> id(False)
> Should it be?
Well, True and False are singletons, but numpy.any() and numpy.all()
don't return bools. They return numpy.bool_s.
"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
-- Umberto Eco
More information about the Numpy-discussion