[Numpy-discussion] "False" and "True" not singletons?

Robert Kern robert.kern@gmail....
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
> False
>  >>> id(f)
> 17316364
>  >>> f is False
> False
>  >>> id(False)
> 3294768
>
>
> Should it be?

Well, True and False are singletons, but numpy.any() and numpy.all()
don't return bools. They return numpy.bool_s.

-- 
Robert Kern

"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 mailing list