[issue42248] Raised exception in Enum keeping user objects alive unnecessarily

Antoine Pitrou report at bugs.python.org
Wed Oct 13 13:38:53 EDT 2021


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

It appears this is *not* fixed in 3.10.0:

Python 3.10.0 (default, Oct 13 2021, 08:45:17) [GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import signal, gc
>>> class App: pass
... 
>>> def create_app():
...   app = App()
...   signal.signal(signal.SIGINT, signal.SIG_DFL)
... 
>>> [obj for obj in gc.get_objects() if type(obj) is App]
[]
>>> create_app()
>>> [obj for obj in gc.get_objects() if type(obj) is App]
[<__main__.App object at 0x7f2d3f3f1c30>]

----------
nosy: +pitrou
resolution: fixed -> 
status: closed -> open

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42248>
_______________________________________


More information about the Python-bugs-list mailing list