10 Dec
2010
10 Dec
'10
2:33 p.m.
On Fri, Dec 10, 2010 at 03:13, Nils Becker
Hi,
why is
bool(np.dtype(np.float)) False
?
I came across this when using this python idiom:
def f(dtype=None): ....if not dtype: ........print 'using default dtype'
The default truth value probably should be True, but not for this reason. The correct idiom to use is this: def f(dtype=None): if dtype is None: print 'using default dtype' -- 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