[SciPy-user] bug or feature

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


Hi

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

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

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 ...

TIA
Christian






More information about the SciPy-User mailing list