test for None

BartlebyScrivener rpdooling at gmail.com
Tue Apr 18 21:32:32 EDT 2006


I think I was trying for something like this, where the intervening for
iterates over a function that may or may not produce nothing:

>>>>x = None
>>>>for x in []:
               print x

>>>>if x is None:
               print "x is still none because nothing happened"

Thanks,

rick




More information about the Python-list mailing list