Equality and identity

Marius Bernklev mariube+netnews+ at ifi.uio.no
Tue Mar 30 22:12:41 CEST 2004

cookedm+news at physics.mcmaster.ca (David M. Cooke) writes:

> In your example, 5 and "hei", for various reasons, are compiled to
> reference the exact same object, so 'is' returns True. However, no
> such caching is done with tuples, so (5,2) and (5,2) compile to
> references to different objects (whose contents are equal).


        "Who needs crypto WYCWLT?"
                -- William Newman

More information about the Python-list mailing list