Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #79737

Re: id == vs is

Date 2014-10-26 17:23 -0700
From Ethan Furman <ethan@stoneleaf.us>
Subject Re: id == vs is
References <CAGGBd_qwcZuReU6rY9bcAa-xH2Kc25dCjubF2SsjppxP3L3J9Q@mail.gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.15210.1414370016.18130.python-list@python.org> (permalink)

Show all headers | View raw


On 10/26/2014 05:12 PM, Dan Stromberg wrote:
> Are the following two expressions the same?
>
> x is y
>
> Id(x) == id(y)
>
> ?

Nope.  If the value if `id(x)` is not interned, then the two value could be different objects that still represent the 
same value.

--
~Ethan~

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: id == vs is Ethan Furman <ethan@stoneleaf.us> - 2014-10-26 17:23 -0700

csiph-web