[issue39824] Multi-phase extension module (PEP 489): don't call m_traverse, m_clear nor m_free before the module state is allocated

Nick Coghlan report at bugs.python.org
Sun Mar 15 23:20:23 EDT 2020


Nick Coghlan <ncoghlan at gmail.com> added the comment:

Petr's point that any subclass state should be managed in the subclass cleanup functions is a good one, so I withdraw my concern:

* custom module subclasses should clean up like any other class instance
* the module slots are then only needed if the module state actually gets populated, so we can safely skip them if it never even gets allocated

----------

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


More information about the Python-bugs-list mailing list