On 2012-01-22, Steven D'Aprano wrote:
> On Sat, 21 Jan 2012 19:36:32 -0800, Chris Rebert wrote:
>
>> On Sat, Jan 21, 2012 at 7:04 PM, Tamer Higazi
>> wrote:
>>> Hi people!
>>> I have asked myself the following thing.
>>>
>>> How do I access the address of an object
>>
>> id(obj) happens to do th
Steven D'Aprano wrote:
> On the other hand, presumably this means that Jython objects need an
> extra field to store the ID, so the CPython approach is a space
> optimization.
>
Given that using `id()` is such an uncommon occurence I would expect the
ids to be stored outside the object in som
On Sat, 21 Jan 2012 19:36:32 -0800, Chris Rebert wrote:
> On Sat, Jan 21, 2012 at 7:04 PM, Tamer Higazi
> 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
> de
On Sun, 22 Jan 2012 04:04:08 +0100, Tamer Higazi wrote:
> Hi people!
> I have asked myself the following thing.
>
> How do I access the address of an object and later get the object from
> that address ?!
Use another language.
By design, Python does not provide pointers. This is a good thing,
On Sun, Jan 22, 2012 at 2:04 PM, Tamer Higazi wrote:
> Hi people!
> I have asked myself the following thing.
>
> How do I access the address of an object and later get the object from
> that address ?!
The problem with that sort of idea is that it mucks up garbage
collection. CPython, for example
On Sat, Jan 21, 2012 at 7:04 PM, Tamer Higazi 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.
> and later get the object from
> that address ?!
Not possible.