Ref Count Checking

Markus Schaber markus at schabi.de
Wed Aug 29 15:35:57 EDT 2001


Hi,

Robin Becker <robin at jessikat.fsnet.co.uk> schrub:

> As part of an extension debugging exercise I printed refcounts
> relating to the structure
> ('a1', {'z1': 'az1'}, ['b1', ('c1', {'y1': 'ay1'}, ['d1'], None),
> 'e1'], None) either created directly in Python or by my extension.
> 
> 
> An earlier pass revealed values of decrementing values
> for the None output from the extension (it was stealing a None).
> After Correcting I'm still getting differences.
> In particular the strings az1, ay1, b1, c1, d1, e1 seem to have counts
> from the extension which are 3 lower than from the python version.
> 
> Is there any way to deduce what the python count should be?
> I'm assuming that a string like az1 is reasonably unique so there
> shouldn't be any question of a library reference.

As Strings are unique, and internalized, may be the module as such 
(compiled code) contains references to the strings?

markus
-- 
"The strength of the Constitution lies entirely in the determination of 
each citizen to defend it. Only if every single citizen feels duty 
bound to do his share in this defense are the constitutional rights 
secure." -- Albert Einstein



More information about the Python-list mailing list