id() and is operator

Chris Angelico rosuav at gmail.com
Sun Feb 22 16:36:22 EST 2015


On Mon, Feb 23, 2015 at 8:25 AM, Marko Rauhamaa <marko at pacujo.net> wrote:
> This is a true statement:
>
>    If X is Y, then id(X) == id(Y).
>
> However, this is generally not a true statement:
>
>    If X is Y, then id(X) is id(Y).

Irrelevant, because the identities of equal integers didn't come into this.

ChrisA



More information about the Python-list mailing list