Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!eweka.nl!hq-usenetpeers.eweka.nl!xlned.com!feeder7.xlned.com!news2.euro.net!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.024 X-Spam-Evidence: '*H*': 0.95; '*S*': 0.00; 'cpython': 0.05; 'bits': 0.07; 'function,': 0.07; 'before.': 0.09; "object's": 0.09; 'objects.': 0.09; 'cc:addr:python-list': 0.10; '(virtual)': 0.16; 'integer.': 0.16; 'jython,': 0.16; 'long).': 0.16; 'wrote:': 0.17; 'integer': 0.17; 'memory': 0.18; '(or': 0.18; 'versions': 0.20; 'equivalent': 0.20; 'amounts': 0.22; 'converted': 0.22; "i'd": 0.22; 'cc:2**0': 0.23; 'cc:no real name:2**0': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'header :User-Agent:1': 0.26; 'values': 0.26; '(e.g.': 0.27; 'object,': 0.27; 'implies': 0.29; 'invoke': 0.29; 'steven': 0.29; 'objects': 0.29; 'maybe': 0.29; 'subject: ?': 0.30; 'function': 0.30; 'addresses': 0.32; 'function.': 0.33; 'int': 0.33; 'shift': 0.33; 'likely': 0.33; 'point.': 0.33; 'version': 0.34; 'pm,': 0.35; 'next': 0.35; 'really': 0.36; 'but': 0.36; 'subject:with': 0.36; 'should': 0.36; 'does': 0.37; 'two': 0.37; 'uses': 0.37; 'subject:: ': 0.38; 'fact': 0.38; 'object': 0.38; 'some': 0.38; 'sure': 0.38; 'step': 0.39; 'received:192': 0.39; 'called': 0.39; 'where': 0.40; 'received:192.168': 0.40; 'think': 0.40; 'claim': 0.60; "you've": 0.61; 'more': 0.63; 'header:Reply-To:1': 0.68; 'physical': 0.69; 'received:74.208': 0.71; 'reply-to:no real name:2**0': 0.72; 'guaranteed': 0.76; 'address,': 0.79; 'fast!': 0.84; 'lifetime.': 0.84; 'moves': 0.84; 'mistakenly': 0.91; 'angel': 0.93 Date: Wed, 05 Sep 2012 13:19:24 -0400 From: Dave Angel User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120714 Thunderbird/14.0 MIME-Version: 1.0 To: Hans Mulder Subject: Re: is implemented with id ? References: <5047648f$0$29981$c3e8da3$5496439d@news.astraweb.com> <50478216$0$6864$e4fe514c@news2.news.xs4all.nl> In-Reply-To: <50478216$0$6864$e4fe514c@news2.news.xs4all.nl> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:pVxmWsPkHQwwoO/ldo5N2UY5GlRXPdkIeiPB8WzflYw 6E6HqpmasPw5RXa0yrX0cTaphH1kVCJUS1xV3LiPNL/ozxMYOw TM2G8wJRWN5wMYM1JPH+7BEEGW8uPokIAhF7f/RHG6/xt3OvEP kwmicQZ2SYytRTgIk2eD9RK3dvN4VrG1Bb9z0eMo+sh+d/L87m BEea6b/75zMUn3EGJNICAA6HR91xB1Smv7pexnuxLYWhnwi/oU 4im7xN21zv8wBUkbYozav1M1Bepe6usaNawEKSDaYMXu0J2h2T NGpI09aNRj1p1RlyTyvuXYXIcnjWEeO65dcEjTcvwbxVne8YA= = Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: d@davea.name 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: 38 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1346865590 news.xs4all.nl 6942 [2001:888:2000:d::a6]:33563 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:28528 On 09/05/2012 12:47 PM, Hans Mulder wrote: > On 5/09/12 17:09:30, Dave Angel wrote: >> But by claiming that id() really means address, and that those addresses >> might move during the lifetime of an object, then the fact that the id() >> functions are not called simultaneously implies that one object might >> move to where the other one used to be before the "move." > Whoa! Not so fast! The id() of an object is guaranteed to not > change during the object's lifetime. So if an implementation > moves objects around (e.g. Jython), then it cannot use memory > addresses for the id() function. Which is equivalent to my point. I had mistakenly thought that Steven was claiming it was always an address, and disproving that claim by what amounts to reductio ad absurdem. >> I think it much more likely that jython uses integer values for >> the id() function, and not physical addresses. > The id() function is guaranteed to return some flavour of integer. > > In Jython, the return values are 1, 2, 3, 4, etc., except, of course, > if you invoke id() on an object you've id'd before, you get the same > number as before. > > In current versions of CPython, you do get the (virtual) memory > address, converted to an int (or a long). But then, CPython does > not move objects. > > Maybe the next version of CPython should shift id values two or three > bits to the right, just to make sure people don't misinterpret ids as > memory addresses. > > I think i'd prefer if it would put it through one step of a CRC32. -- DaveA