'is' versus '=='

Fredrik Lundh fredrik at pythonware.com
Mon May 7 13:39:51 EDT 2001


Aaron Ginn wrote:
>
> Maybe I have an incorrect understanding of the 'is' operator, but I
> was under the impression that 'is' and '==' operated the same way.

"x is y" is the same thing as "id(x) == id(y)".  if that's
not what you want, stay away from "is".

Cheers /F





More information about the Python-list mailing list