Antoine Pitrou <[email protected]> added the comment:
Bob, here is a small example showing how easy it is to encounter the GC
problem:
from json import JSONDecoder
import weakref
import gc
class MyObject(object):
def __init__(self):
self.decoder = JSONDecoder(parse_constant=self.parse_constant)
def parse_constant(self, *args, **kargs):
""" XXX """
wr = weakref.ref(MyObject())
gc.collect()
print wr()
----------
keywords: -26backport
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue4136>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com