Message396316
It is possible to create a module without a dictionary:
m = types.ModuleType.__new__(types.ModuleType)
But that is the only way to create to a module without a dict; all other means of creating a module, both in Python and in the C API, result in a fully formed module.
Existing code expects that modules will always have a dictionary, e.g.
https://github.com/python/cpython/blob/3.10/Include/internal/pycore_moduleobject.h#L35
We should change types.ModuleType.__new__ to properly initialize the module. |
|
Date |
User |
Action |
Args |
2021-06-22 09:53:42 | Mark.Shannon | set | recipients:
+ Mark.Shannon |
2021-06-22 09:53:42 | Mark.Shannon | set | messageid: <1624355622.79.0.135643740949.issue44486@roundup.psfhosted.org> |
2021-06-22 09:53:42 | Mark.Shannon | link | issue44486 messages |
2021-06-22 09:53:42 | Mark.Shannon | create | |
|