[issue28202] Python 3.5.1 C API, the global variable is not destroyed when delete the module

Nick Coghlan report at bugs.python.org
Wed Sep 21 10:58:24 EDT 2016


Nick Coghlan added the comment:

The most likely relevant difference here is that Python 3.4+ no longer forcibly break cycles through the module globals when the module is deallocated: https://docs.python.org/dev/whatsnew/3.4.html#whatsnew-pep-442

Due to the implicit cycles created between function definitions and their global namespace via the __globals__ attribute on the function, this means that embedding applications will need to explicitly run a GC collection cycle after deleting a module in order to fully finalise it.

----------

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


More information about the Python-bugs-list mailing list