Replies: 1 comment
-
You've discovered an experimental (and undocumented) feature that I implemented in support of my recent explorations related to tensor shape type checking. You're correct that the code above is not allowed by the typing spec currently. You'll see that mypy produces errors here. I could have added this support under the |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This seems similar to #7317, however in their code pyright did show errors.
The following MRE typechecks without issues:
In the definition of
func1
, theUnpack
in the return type seems allowed, but is ignored. When replaced with*TupleT
, pyright reports:In the definition of
func2
, bothUnpack
and*
ofTupleT
is allowed within atuple
; the returned callable has an inconsistent parameter count depending on the accepted tuple type being a parametrized tuple, or a NamedTuple (of same length).I believe the intended behavior is to error in all of the cases above due to
TupleT
not being a valid type to unpack?Beta Was this translation helpful? Give feedback.
All reactions