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 Gobot1234
Recipients Gobot1234, gvanrossum, kj
Date 2021-12-24.00:01:32
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1640304092.48.0.180382760459.issue46170@roundup.psfhosted.org>
In-reply-to
Content
I'd like to propose making the error message when subclassing typing.NewType much more understandable. Currently it looks like:
```
TypeError: NewType.__init__() takes 3 positional arguments but 4 were given
```
But I think we could do much better by adding __mro_entries__ to the class and then just having that raise a TypeError telling users they cannot subclass NewType and they are probably looking for `NewType('Subclass', OlderType)`. I'd be happy to patch this myself if this sounds like a good idea.
History
Date User Action Args
2021-12-24 00:01:32Gobot1234setrecipients: + Gobot1234, gvanrossum, kj
2021-12-24 00:01:32Gobot1234setmessageid: <1640304092.48.0.180382760459.issue46170@roundup.psfhosted.org>
2021-12-24 00:01:32Gobot1234linkissue46170 messages
2021-12-24 00:01:32Gobot1234create