"saeed.gnu" <saeed....@gmail.com> writes: > "x is y" means "id(y) == id(y)" > "x is not y" means "id(x) != id(x)" > "x is not None" means "id(x) != id(None)"
No, the meanings are different. The behaviour might, or might not, be the same. The operators are different *because* the meanings are different. > "x is not None" is a really silly statement!! because id(None) and id > of any constant object is not predictable! The value returned from ‘id’ is not predictable; but it doesn't need to be predictable. It merely needs to obey the invariant that the identity of any given object won't change during the object's lifetime. -- \ “You've got the brain of a four-year-old boy, and I'll bet he | `\ was glad to get rid of it.” —Groucho Marx | _o__) | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list