Message414294
The following crashes the interpreter in Python 3.11, and works fine in older versions:
# --- script.py
import types
class MyModule (types.ModuleType):
__slots__ = (
"_MyModule__a",
"_MyModule__b",
)
def __init__(self, name):
super().__init__(name)
m = MyModule("name")
# -- end of file
The key in this is the ``__slots__`` definition: The script does not crash without ``__slots__``, or with a slots tuple with 1 item.
This is a reproducer based on code in PyObjC. |
|
Date |
User |
Action |
Args |
2022-03-01 21:25:06 | ronaldoussoren | set | recipients:
+ ronaldoussoren |
2022-03-01 21:25:06 | ronaldoussoren | set | messageid: <1646169906.66.0.789674820049.issue46891@roundup.psfhosted.org> |
2022-03-01 21:25:06 | ronaldoussoren | link | issue46891 messages |
2022-03-01 21:25:06 | ronaldoussoren | create | |
|