On 2014-08-18 21:35, ElChino wrote:
A newbie question to you; what is the difference between statements
like:
if x is not None:
and
if x != None:
Without any context, which one should be preferred?
IMHO, the latter is more readable.
"x == y" tells you whether x and y refer to objects that are equal.
"x is y" tells you whether x and y actually refer to the same object.
In the case of singletons like None (there's only one None object),
it's better to use "is".
--
https://mail.python.org/mailman/listinfo/python-list