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


Groups > comp.lang.python > #79737 > unrolled thread

Re: id == vs is

Started byEthan Furman <ethan@stoneleaf.us>
First post2014-10-26 17:23 -0700
Last post2014-10-26 17:23 -0700
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

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

#79737 — Re: id == vs is

FromEthan Furman <ethan@stoneleaf.us>
Date2014-10-26 17:23 -0700
SubjectRe: id == vs is
Message-ID<mailman.15210.1414370016.18130.python-list@python.org>
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~

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web