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


Groups > comp.lang.python > #79781

Re: id == vs is

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!us.feeder.erje.net!bloom-beacon.mit.edu!bloom-beacon.mit.edu!panix!roy
From Roy Smith <roy@panix.com>
Newsgroups comp.lang.python
Subject Re: id == vs is
Date Mon, 27 Oct 2014 09:17:34 -0400
Organization PANIX Public Access Internet and UNIX, NYC
Lines 13
Message-ID <roy-53C705.09170427102014@news.panix.com> (permalink)
References <544D94B5.80502@mrabarnett.plus.com> <mailman.15221.1414379336.18130.python-list@python.org>
NNTP-Posting-Host localhost
X-Trace reader1.panix.com 1414415854 19346 127.0.0.1 (27 Oct 2014 13:17:34 GMT)
X-Complaints-To abuse@panix.com
NNTP-Posting-Date Mon, 27 Oct 2014 13:17:34 +0000 (UTC)
User-Agent MT-NewsWatcher/3.5.3b3 (Intel Mac OS X)
Xref csiph.com comp.lang.python:79781

Show key headers only | 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