Stringify object reference?
Alan Kennedy
alanmk at hotmail.com
Fri Oct 11 13:17:33 EDT 2002
Alan Kennedy wrote:
>> Basically, I'm looking for the python equivalent of a CORBA IOR.
>>
>> Any suggestions? Or am I missing something completely obvious?
holger krekel wrote:
> Python's id of an object 'id(obj)' won't help you at all. There
> is no mechanism for reinstantiating an object by its serialized
> id. You probably should look for CORBA-Orbs such as Fnorb or
> OmniORB. Or maybe the Zope Object DataBase (ZODB) would fit
> your needs.
>
> A bit more context might help us to help you <wink>.
As I mentioned in my original post, I want to annotate (generic) XML
tree-like object models (e.g. DOM, etc) with my own python objects.
The only way I can see to do it is to to store my objects, or a
reference thereto, into an XML attribute, which limits me to some
ascii/charset representation.
I realise I could pickle() the whole object, and put that into the
attribute. But that would be highly memory inefficient, unless I delete
the original object that was pickled, which would be time inefficient.
I'm beginning to think I have to maintain my own namespace/dictionary
for these things, indexed by id(object). Which is an acceptable
solution.
Is there a specific reason why id()'s can't be turned back into objects?
Is it an implementation specific thing? Or is it to stop people messing
with pointers, etc?
Regards,
alan kennedy
-----------------------------------------------------
check http headers here: http://xhaus.com/headers
email alan: http://xhaus.com/mailto/alan
More information about the Python-list
mailing list