On Mon, 09 Aug 2010 04:41:23 -0700, saeed.gnu wrote: > "x is not None" is a really silly statement!! because id(None) and id > of any constant object is not predictable! I don't know whay people > use "is" instead of "==". you should write "if x!=None" instead of "x > is not None"
No, you should use the identity check. If you use ==, the operand may have an __eq__ or __cmp__ method which considers the object equal to None. -- http://mail.python.org/mailman/listinfo/python-list