Message409114
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. |
|
Date |
User |
Action |
Args |
2021-12-24 00:01:32 | Gobot1234 | set | recipients:
+ Gobot1234, gvanrossum, kj |
2021-12-24 00:01:32 | Gobot1234 | set | messageid: <1640304092.48.0.180382760459.issue46170@roundup.psfhosted.org> |
2021-12-24 00:01:32 | Gobot1234 | link | issue46170 messages |
2021-12-24 00:01:32 | Gobot1234 | create | |
|