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


Groups > comp.lang.python > #28528

Re: is implemented with id ?

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 <d@davea.name>
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 <d@davea.name>
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120714 Thunderbird/14.0
MIME-Version 1.0
To Hans Mulder <hansmu@xs4all.nl>
Subject Re: is implemented with id ?
References <franck-9EED34.08303005092012@news.free.fr> <mailman.213.1346827305.27098.python-list@python.org> <franck-053A38.15194605092012@news.free.fr> <mailman.239.1346853638.27098.python-list@python.org> <5047648f$0$29981$c3e8da3$5496439d@news.astraweb.com> <mailman.244.1346857794.27098.python-list@python.org> <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 <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.258.1346865590.27098.python-list@python.org> (permalink)
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

Show key headers only | View raw


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

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


Thread

is implemented with id ? Franck Ditter <franck@ditter.org> - 2012-09-05 08:30 +0200
  Re: is implemented with id ? Benjamin Kaplan <benjamin.kaplan@case.edu> - 2012-09-04 23:40 -0700
    Re: is implemented with id ? Franck Ditter <franck@ditter.org> - 2012-09-05 15:19 +0200
      Re: is implemented with id ? Hans Mulder <hansmu@xs4all.nl> - 2012-09-05 15:48 +0200
        Re: is implemented with id ? aahz@pythoncraft.com (Aahz) - 2012-11-03 12:41 -0700
          Re: is implemented with id ? Hans Mulder <hansmu@xs4all.nl> - 2012-11-03 22:49 +0100
            Re: is implemented with id ? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-11-03 22:18 +0000
              Re: is implemented with id ? Chris Angelico <rosuav@gmail.com> - 2012-11-04 09:50 +1100
              Re: is implemented with id ? Oscar Benjamin <oscar.j.benjamin@gmail.com> - 2012-11-04 01:14 +0000
                Re: is implemented with id ? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-11-04 03:10 +0000
                Re: is implemented with id ? Chris Angelico <rosuav@gmail.com> - 2012-11-04 14:19 +1100
                Re: is implemented with id ? aahz@pythoncraft.com (Aahz) - 2012-11-03 22:09 -0700
                Re: is implemented with id ? Hans Mulder <hansmu@xs4all.nl> - 2012-11-04 11:13 +0100
              Re: is implemented with id ? Chris Angelico <rosuav@gmail.com> - 2012-11-04 12:22 +1100
              Re: is implemented with id ? aahz@pythoncraft.com (Aahz) - 2012-11-03 22:08 -0700
            Re: is implemented with id ? Roy Smith <roy@panix.com> - 2012-11-03 18:41 -0400
            Re: is implemented with id ? aahz@pythoncraft.com (Aahz) - 2012-11-03 22:12 -0700
      Re: is implemented with id ? Dave Angel <d@davea.name> - 2012-09-05 10:00 -0400
        Re: is implemented with id ? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-09-05 14:41 +0000
          Re: is implemented with id ? Dave Angel <d@davea.name> - 2012-09-05 11:09 -0400
            Re: is implemented with id ? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-09-05 15:36 +0000
            Re: is implemented with id ? Hans Mulder <hansmu@xs4all.nl> - 2012-09-05 18:47 +0200
              Re: is implemented with id ? Dave Angel <d@davea.name> - 2012-09-05 13:19 -0400
          Re: is implemented with id ? Terry Reedy <tjreedy@udel.edu> - 2012-09-05 14:31 -0400
          Re: is implemented with id ? Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-09-05 22:08 -0400
          Re: is implemented with id ? Duncan Booth <duncan.booth@invalid.invalid> - 2012-09-06 09:34 +0000
            Re: is implemented with id ? Chris Angelico <rosuav@gmail.com> - 2012-09-06 19:50 +1000
          Re: is implemented with id ? 88888 Dihedral <dihedral88888@googlemail.com> - 2012-11-04 01:33 -0700
  Re: is implemented with id ? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-09-05 09:14 +0000
    Re: is implemented with id ? Ramchandra Apte <maniandram01@gmail.com> - 2012-09-05 05:48 -0700
      Re: is implemented with id ? Dave Angel <d@davea.name> - 2012-09-05 09:46 -0400
      Re: is implemented with id ? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-09-05 14:13 +0000
        Re: is implemented with id ? Ian Kelly <ian.g.kelly@gmail.com> - 2012-09-05 11:08 -0600
        Re: is implemented with id ? Chris Angelico <rosuav@gmail.com> - 2012-09-06 19:07 +1000
      Re: is implemented with id ? Terry Reedy <tjreedy@udel.edu> - 2012-09-05 14:27 -0400
        Re: is implemented with id ? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-09-06 06:44 +0000
          Re: is implemented with id ? Ramchandra Apte <maniandram01@gmail.com> - 2012-09-06 01:24 -0700
          Re: is implemented with id ? Roy Smith <roy@panix.com> - 2012-09-06 08:16 -0400
            Re: is implemented with id ? Ramchandra Apte <maniandram01@gmail.com> - 2012-09-06 06:30 -0700
      Re: is implemented with id ? Dave Angel <d@davea.name> - 2012-09-05 14:40 -0400

csiph-web