Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 2k
Closed
Description
A recent change to the tuple.__new__ method in builtins.pyi introduced an overload:
@overloaddef__new__(cls) ->tuple[()]: ...This overload is problematic for classes that derive from specialized tuples.
classMyTuple(tuple[int, str, str]): ... x=MyTuple() reveal_type(x) # tuple[()] !!!!Because of this overload, the wrong type is evaluated.
I think this overload should return Self, not tuple[()]. Admittedly, that doesn't produce the ideal type evaluation for tuple(). It produces tuple[Any, ...] rather than tuple[()].
AlexWaygood
Metadata
Metadata
Assignees
Labels
No labels