On Sun, Jan 22, 2012 at 2:04 PM, Tamer Higazi <th9...@googlemail.com> 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, maintains a reference count for every object; your address is, in a sense, another reference, but one that the GC doesn't know about - so it might release the object and reuse the memory. What you can do, though, is simply have another name bound to the same object. You can then manipulate the object through that name, and it'll function just like a pointer would in C. The original name and the new name will function exactly the same. ChrisA -- http://mail.python.org/mailman/listinfo/python-list