Hi, I ran the following code in the Python interpreter and am trying to determine if the behavior I see is expected: import sys print sys.getrefcount(globals()) class Foo(object): def __init__(self): pass print sys.getrefcount(globals()) The first print statement above prints '4' and the second one prints '5'. However, if I remove the __init__ method from the class, the refcount stays the same. If I change the above code like this, the ref count stays the same: import gc import sys print sys.getrefcount(globals()) class Foo(object): def __init__(self): pass del Foo while gc.collect(): pass print sys.getrefcount(globals()) Can you let me know if this is a bug in the Python interpreter? -Chandra -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20140523/d6ee9a18/attachment.html>
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