serializable object references

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Sun Apr 22 16:23:35 CEST 2007


En Sun, 22 Apr 2007 08:07:27 -0300, Martin Drautzburg  
<Martin.Drautzburg at web.de> escribió:

> Is it possible to convert an object into a string that identifies the
> object in a way, so it can later be looked up by this string.
> Technically this should be possible, because things like
>
> <__main__.Foo instance at 0xb7cfb6ac>
>
> say everything about an object. But how can I look up the real object,
> when I only have this string?
>
> I know such a thing can be achieved with a dictionary that holds
> reference-object pairs. Is there another way?

Without further information, this would be the way.
What do you want to achieve? Maybe you are looking for the pickle module.

-- 
Gabriel Genellina



More information about the Python-list mailing list