It is __del__ calling twice for some instances?

Max Yuzhakov gmt at sdf-eu.org
Fri Aug 18 18:32:18 EDT 2006


Duncan Booth wrote:

 DB>  BTW, the behaviour is completely different if you use a new style class, 
 DB>  but still somewhat bizarre: for new style classes only the first 25 objects 
 DB>  get freed when you clear a, the remainder are only released by the garbage 
 DB>  collector.

If to add the third call of stat() after the second,
the result became such:

--------------------
ini_cnt = 500001
del_cnt = 0
difference = 500001
--------------------
ini_cnt = 500001
del_cnt = 25
difference = 499976
--------------------
ini_cnt = 500001
del_cnt = 500001
difference = 0

Preceding call to gc.disable() has no influence on result.
-- 
GMT More Then ...



More information about the Python-list mailing list