Frans Englich schrieb:
What is the equivalent expression which is more secure; `!= None`?

Note that this is not necessarily equivalent. '!=' and '==' possibly run method calls on objects which can be costly depending on their implementation and can even raise exceptions if called with None. If I want to check for None, I always do it with "is". It's a constant after all...

Stefan
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to