New submission from Ronald Oussoren <ronaldousso...@mac.com>:
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. ---------- components: Interpreter Core keywords: 3.11regression messages: 414294 nosy: ronaldoussoren priority: normal severity: normal stage: needs patch status: open title: Crash in ModuleType subclass with __slots__ type: crash versions: Python 3.11 _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue46891> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com