[SciPy-user] bug or feature

Christian Meesters meesters at uni-mainz.de
Tue Aug 16 07:48:46 CDT 2005


I'm using scipy 0.3.2 and run into troubles. To illustrate them just 

 >>> x = None
 >>> if x: print 'hello' #nothing happens here
 >>> from scipy import *
 >>> a = array(None)
 >>> if a: print 'hello' #will print 'hello', why?
 >>> print a

I consider it a nice feature that no exception is raised when None is 
passed to array(), but apparently 'None' in Python is something 
different than 'None' in SciPy - or is it? Should I know about this? 
How should I deal with it? Asking with 'if' does not really work here 
to check whether an object 'really' exists. And using try/except for 
every possible case is not really feasible ...


More information about the SciPy-user mailing list