Perl and Python, a practical side-by-side example.
Bjoern Schliessmann
usenet-mail-0306.20.chr0n0ss at spamgourmet.com
Sat Mar 3 02:07:25 EST 2007
Bruno Desthuilliers wrote:
> Shawn Milo a écrit :
>> if recs.has_key(piid) is False:
>
> 'is' is the identity operator - practically, in CPython, it
> compares memory addresses. You *dont* want to use it here.
It's recommended to use "is None"; why not "is False"? Are there
multiple False instances or is False generated somehow?
Regards,
Björn
--
BOFH excuse #135:
You put the disk in upside down.
More information about the Python-list
mailing list