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


Groups > comp.lang.python > #79781

Re: id == vs is

From Roy Smith <roy@panix.com>
Newsgroups comp.lang.python
Subject Re: id == vs is
Date 2014-10-27 09:17 -0400
Organization PANIX Public Access Internet and UNIX, NYC
Message-ID <roy-53C705.09170427102014@news.panix.com> (permalink)
References <544D94B5.80502@mrabarnett.plus.com> <mailman.15221.1414379336.18130.python-list@python.org>

Show all headers | View raw


In article <mailman.15221.1414379336.18130.python-list@python.org>,
 Cameron Simpson <cs@zip.com.au> wrote:

> The "is" test is more direct and less subject to iffiness because the longer 
> expression using id() leaves more scope/time for things to change, and of 
> course "id" itself can be rebound to something weird.

Not to mention that Python is case-sensitive and in the code as 
presented by the OP:

>>>>Id(x) == id(y)

those are two different functions :-)

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


Thread

Re: id == vs is Cameron Simpson <cs@zip.com.au> - 2014-10-27 13:36 +1100
  Re: id == vs is Roy Smith <roy@panix.com> - 2014-10-27 09:17 -0400

csiph-web