S
Steven Watanabe
PEP 8 says, "Comparisons to singletons like None should always be done
with 'is' or 'is not', never the equality operators." I know that "is"
is an identity operator, "==" and "!=" are the equality operators, but
I'm not sure what other singletons are being referred to here.
Also, I've seen code that does things like:
if foo is 3:
if foo is not '':
Are these valid uses of "is"?
Thanks in advance.
with 'is' or 'is not', never the equality operators." I know that "is"
is an identity operator, "==" and "!=" are the equality operators, but
I'm not sure what other singletons are being referred to here.
Also, I've seen code that does things like:
if foo is 3:
if foo is not '':
Are these valid uses of "is"?
Thanks in advance.