-
Once again, hats off to Pyright for taking the lead on implementing the draft PEP 646. I'm trying to make use of the type concatenation feature of the PEP. The example below is straight from the PEP (except for using from typing import Generic, NewType
from typing_extensions import TypeVarTuple, Unpack
Shape = TypeVarTuple("Shape")
Batch = NewType("Batch", int)
class Array(Generic[Unpack[Shape]]):
...
def add_batch_axis(x: Array[Unpack[Shape]]) -> Array[Batch, Unpack[Shape]]: # Pyright complains "TypeVarTuple not allowed in this context"
... |
Beta Was this translation helpful? Give feedback.
Answered by
erictraut
Sep 21, 2021
Replies: 1 comment 1 reply
-
Thanks for kicking the tires on this support. It hasn't gotten much use yet, which is understandable given that the PEP has not yet been ratified. You're correct that this is a bug. The fix will be in the next release. |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
dnaaun
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for kicking the tires on this support. It hasn't gotten much use yet, which is understandable given that the PEP has not yet been ratified. You're correct that this is a bug. The fix will be in the next release.