Object Reference?

Chris S. chrisks at NOSPAMudel.edu
Fri Aug 6 18:40:18 CEST 2004


Michael Hudson wrote:

>>Naturally, I could just recursively parse all the data comparing every
>>element to every previously listed object, but is there a less
>>obtrusive method? Python figures out when to delete objects based on
>>the remaining references to an object. Is there a way to access this
>>information to automatically lookup these references? Any help is
>>greatly appreciated.
> 
> 
> Well, there's gc.get_referrers() and gc.get_referrents(), but I think
> they are probably overkill (see above).

Thanks, these are exactly what I need. Pickle is just the file format. 
The data are Python constructs, so I shouldn't have to bother with the 
format at all, since I'm simply converting the Pickled file into generic 
Python data. Plus, writing my own Pickle parser would be hugely 
complicated since Pickle is essentially its own small programming language.



More information about the Python-list mailing list