[Neil Schemenauer] > Attached is a little program that triggers the behavior. The CVS change > I finally narrowed in on was the addition of similar code to test_descr. Ouch! > A reference counting bug is still by best guess. Guido? Here's the code: import gc gc.disable() def main(): # must be inside function scope class A(object): def __init__(self): self.__super = super(A, self) A() main() print 'first collect', gc.collect() print 'second collect', gc.collect() The first collect is getting these: [<__main__.A object at 0x0066A090>, <super: <class 'A'>, <A object>>, {'_A__super': <super: <class 'A'>, <A object>>} ] The second is getting these: [<class '__main__.A'>, {'__dict__': <attribute '__dict__' of 'A' objects>, '__module__': '__main__', '__weakref__': <member '__weakref__' of 'A' objects>, '__doc__': None, '__init__': <function __init__ at 0x00674C70>}, (<class '__main__.A'>, <type 'object'>), (<type 'object'>,), <attribute '__dict__' of 'A' objects>, <member '__weakref__' of 'A' objects>, <function __init__ at 0x00674C70>, (<cell at 0x0066A110: type object at 0x007687B0>,), <cell at 0x0066A110: type object at 0x007687B0> ] For some reason, the cell nags me. Perhaps because of your "must be inside function scope" comment, and that cells are poorly understood by me <wink>.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4