How to do this in Python...
Aahz
aahz at pythoncraft.com
Sat Jan 25 19:23:12 EST 2003
In article <3E30B17C.AE4AFE5C at alcyone.com>,
Erik Max Francis <max at alcyone.com> wrote:
>Aahz wrote:
>>
>> That seems a bit odd to me. Why test against None, instead of simply
>> "if not match"?
>
>In this particular case, it doesn't much matter, since you're guaranteed
>any non-None match object will evaluate to true. In general, though, if
>you know that a value might be "something" or None, an explicit test
>against None is warranted since that "something" may or may not evaluate
>as false itself.
That's precisely why you *shouldn't* test against None, unless you
specifically want to find out whether None was returned.
--
Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/
"Argue for your limitations, and sure enough they're yours." --Richard Bach
More information about the Python-list
mailing list