-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Open
Labels
bugmypy got something wrongmypy got something wrongtopic-pep-646PEP 646 (TypeVarTuple, Unpack)PEP 646 (TypeVarTuple, Unpack)
Description
Instances of user-defined variadic tuples subtypes are inferred incorrectly:
class Shape[*Ts](tuple[*Ts]): ...
reveal_type((42, )) # tuple[Literal[42]?]
reveal_type(Shape((42, ))) # __main__.Shape[Unpack[builtins.tuple[Never, ...]]]It should instead be inferred as Shape[Literal[42]].
This occurs with both mypy 1.15 and the current master branch.
related: #19093, #19105
ref: #19100 (comment)
Metadata
Metadata
Assignees
Labels
bugmypy got something wrongmypy got something wrongtopic-pep-646PEP 646 (TypeVarTuple, Unpack)PEP 646 (TypeVarTuple, Unpack)