[issue2521] ABC caches should use weak refs

Antoine Pitrou report at bugs.python.org
Wed Mar 31 01:38:21 CEST 2010


Antoine Pitrou <pitrou at free.fr> added the comment:

By the way, Daniel, your patch doesn't look right.
First, you shouldn't need all the sortedlist/sortedset hierarchy.
Second, len(gc.get_objects()) is a truly horrible way of checking the classes have been destroyed. Just take a weakref to the class before deleting it, and check that calling the weakref returns None.
(besides, we also have a refleak-detection run (regrtest -R) which can detect leaks even if you don't check them explicitly in your tests)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue2521>
_______________________________________


More information about the Python-bugs-list mailing list