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 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: References: <544D94B5.80502@mrabarnett.plus.com> 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 In article , Cameron Simpson 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 :-)