Memory addressing

Carsten Haese carsten at uniqsys.com
Fri Apr 27 15:52:41 EDT 2007


On Fri, 2007-04-27 at 12:41 -0700, Simon Berube wrote:
> Hi,
> 
>    I have a rather simple question for which I couldn't find an
> answer. I noticed how a significant number of objects in Python return
> a __repr__() string along the lines of :
> 
> < Object at 0xXXXXXX>
> 
>    I find this notation quite convenient to avoid out of control
> strings when using large arrays but I was wondering how you can use
> the memory address for assigning a new object.

You can't.

> In c, one could simple have a pointer to that memory address and
> voila, you have a new object you can analyze however it seems like
> python is allergic to direct memory manipulation.

For good reason. Python is not C.

> Hence, I was wondering what is the correct way to go about obtaining
> objects returned in such a fashion? What am I going wrong or what am I
> not getting?

What is the actual problem you're trying to solve?

-Carsten





More information about the Python-list mailing list