easy question on parsing python: "is not None"

Gregory Ewing greg.ewing at canterbury.ac.nz
Fri Aug 6 21:36:30 EDT 2010


Ethan Furman wrote:

> Instead of using 'is' use '=='.  Maybe not as cute, but definitely more 
> robust!

It's also just as efficient if you use strings that
resemble identifiers, because they will be interned,
so the comparison will end up just doing an indentity
test anyway.

-- 
Greg



More information about the Python-list mailing list