This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ronaldoussoren
Recipients ronaldoussoren
Date 2022-03-01.21:25:06
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1646169906.66.0.789674820049.issue46891@roundup.psfhosted.org>
In-reply-to
Content
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.
History
Date User Action Args
2022-03-01 21:25:06ronaldoussorensetrecipients: + ronaldoussoren
2022-03-01 21:25:06ronaldoussorensetmessageid: <1646169906.66.0.789674820049.issue46891@roundup.psfhosted.org>
2022-03-01 21:25:06ronaldoussorenlinkissue46891 messages
2022-03-01 21:25:06ronaldoussorencreate