Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!goblin1!goblin3!goblin2!goblin.stu.neva.ru!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'operator': 0.03; 'cpython': 0.05; '"""': 0.07; 'memory.': 0.07; 'returned.': 0.07; '(currently': 0.09; 'integers': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'changes': 0.15; '(assuming': 0.16; '-tkc': 0.16; 'address).': 0.16; 'compares': 0.16; 'created;': 0.16; 'flavors': 0.16; 'from:addr:python.list': 0.16; 'from:addr:tim.thechases.com': 0.16; 'from:name:tim chase': 0.16; 'integers,': 0.16; "object's": 0.16; 'objects;': 0.16; 'sequential': 0.16; ':-)': 0.16; 'wrote:': 0.18; 'value.': 0.19; 'memory': 0.22; 'cc:addr:python.org': 0.22; 'documented': 0.24; 'integer': 0.24; 'regardless': 0.24; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; 'compare': 0.26; 'world,': 0.26; 'header:In- Reply-To:1': 0.27; 'function': 0.29; 'constant': 0.31; 'object.': 0.31; 'url:python': 0.33; 'implemented': 0.33; '(2)': 0.35; 'objects': 0.35; 'addresses,': 0.36; 'object,': 0.36; 'representing': 0.36; "i'll": 0.36; 'url:org': 0.36; 'two': 0.37; 'url:library': 0.38; 'ability': 0.39; 'does': 0.39; 'free': 0.61; 'url:3': 0.61; 'address': 0.63; 'skip:n 10': 0.64; 'different': 0.65; 'skip:\xe2 10': 0.65; 'to:addr:gmail.com': 0.65; 'dont': 0.67; 'response.': 0.68; '8bit%:43': 0.74; 'guaranteed': 0.75; 'received:50.22': 0.84; 'url:datamodel': 0.84; 'url:reference': 0.84 Date: Wed, 5 Mar 2014 12:12:54 -0600 From: Tim Chase To: Rustom Mody Subject: Re: Reference In-Reply-To: <60b9aaba-7991-415d-b3c6-dc18c5539502@googlegroups.com> References: <53144e8d$0$2149$426a74cc@news.free.fr> <1d1dfa1b-b715-4d8f-9c12-f0d3dc1a22c9@googlegroups.com> <85ppm3httu.fsf@benfinney.id.au> <20140303155112.46e34ff8@bigbox.christie.dr> <87siqy7whs.fsf@elektro.pacujo.net> <53155c15$0$2923$c3e8da3$76491128@news.astraweb.com> <164d209c-ba5e-449f-bc25-c27ebfb1fc0f@googlegroups.com> <5316b0dc$0$2923$c3e8da3$76491128@news.astraweb.com> <55d6a455-1856-4fd6-ac4b-c277ff7e2bd1@googlegroups.com> <60b9aaba-7991-415d-b3c6-dc18c5539502@googlegroups.com> X-Mailer: Claws Mail 3.8.1 (GTK+ 2.24.10; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - boston.accountservergroup.com X-AntiAbuse: Original Domain - python.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tim.thechases.com X-Get-Message-Sender-Via: boston.accountservergroup.com: authenticated_id: tim@thechases.com Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 51 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1394043152 news.xs4all.nl 2903 [2001:888:2000:d::a6]:41818 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:67865 On 2014-03-05 09:40, Rustom Mody wrote: > Every object has an identity, a type and a value. An object's > identity never changes once it has been created; you may think of > it as the object's address in memory. The 'is' operator compares > the identity of two objects; the id() function returns an integer > representing its identity (currently implemented as its address). >=20 > from http://docs.python.org/2/reference/datamodel.html Note the "currently", which does not mean "now, always, and forever for every implementation". =46rom http://docs.python.org/3/library/functions.html#id """ Return the =E2=80=9Cidentity=E2=80=9D of an object. This is an integer = which is guaranteed to be unique and constant for this object during its lifetime. Two objects with non-overlapping lifetimes may have the same id() value. CPython implementation detail: This is the address of the object in memory. """ This is clearly documented as a *CPython implementation detail*. The id() function is free to return sequential integers, arbitrary integers, memory addresses, GUIDs-as-integers, or hashes-as-integers for some internal representation. The only thing that matters is (1) that id() returns *some* integer identifying the object, and (2) the ability to compare id(thing1) with id(thing2) and see if they are the same or different (assuming thing1 and thing2 share lifetimes during their id() calls), regardless of what is actually returned. > So when you say > > I'll re-iterate that "memory location of the object" isn't a valid > > response.=20 >=20 > well... all I can say is I dont know what to say :-) That you live in a CPython world, unencumbered by experience in other flavors of language-spec-compliant Python interpreters where id() returns integers that *aren't* memory addresses? -tkc