access address from object and vice versa

Grant Edwards invalid at invalid.invalid
Mon Jan 23 10:54:37 EST 2012


On 2012-01-22, Steven D'Aprano <steve+comp.lang.python at pearwood.info> wrote:
> On Sat, 21 Jan 2012 19:36:32 -0800, Chris Rebert wrote:
>
>> On Sat, Jan 21, 2012 at 7:04 PM, Tamer Higazi <th982a at googlemail.com>
>> wrote:
>>> Hi people!
>>> I have asked myself the following thing.
>>>
>>> How do I access the address of an object
>> 
>> id(obj) happens to do that in CPython, but it's a mere implementation
>> detail.
>
> I really wish that CPython didn't expose the fact that id happens to use 
> address. That simply gives people the wrong idea.
>
> Jython has the right approach, in my opinion. Objects are given IDs on 
> request, starting with 1, and no id is ever re-used:

But what happens when Jython runs out of numbers?!?!

-- 
Grant Edwards               grant.b.edwards        Yow! I threw up on my
                                  at               window!
                              gmail.com            



More information about the Python-list mailing list