Re: test for None

2006-04-18 Thread BartlebyScrivener
>> Have you followed the tutorial through, running and understanding each >> example, to get the basics of Python covered? Could be high time to try that again. At first it was way too much, so I've been doing Dive Into Python and some others. But I will try the Tutorial again, at least up to clas

Re: test for None

2006-04-18 Thread Ben Finney
"BartlebyScrivener" <[EMAIL PROTECTED]> writes: > How do you test for a function that returns nothing, A function returns a single value (which may be a container for other values). By default, with no 'return' statement, it returns the None object. What is it you're trying to do? > and why doe

Re: test for None

2006-04-18 Thread BartlebyScrivener
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 -- http://m

Re: test for None

2006-04-18 Thread Erik Max Francis
BartlebyScrivener wrote: > How do you test for a function that returns nothing, and why doesn't > this work? Shouldn't X have to be either None or not? > x = None for x in []: > ... if x is None: > ... print "X is None" > ... else: > ... print "X is not None" > ..