Home
Reading
Searching
Subscribe
Sponsors
Statistics
Posting
Contact
Spam
Lists
Links
About
Hosting
Filtering
Features Download
Marketing
Archives
FAQ
Blog
 
Gmane
From: Nils Becker <n.becker <at> amolf.nl>
Subject: truth value of dtypes
Newsgroups: gmane.comp.python.numeric.general
Date: Friday 10th December 2010 09:13:11 UTC (over 6 years ago)
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'

If there is no good reason to have a False truth value, I would vote for
making it True since that is what one would expect (no?)
N.
 
CD: 3ms