-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat[next]: variadic generic type #1486
feat[next]: variadic generic type #1486
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks good to me. We could also update the quickstart guide with the new syntax in this PR, or we can do it in a different PR? What do you think about it?
tests/next_tests/unit_tests/type_system_tests/test_type_translation.py
Outdated
Show resolved
Hide resolved
…ation.py Co-authored-by: Enrique González Paredes <[email protected]>
…iadic_generic_type
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ILGTM
Variadic generic type: ```python ShapeT = TypeVarTuple("ShapeT") class Dims(Generic[Unpack[ShapeT]]): shape: tuple[Unpack[ShapeT]] DimsT = TypeVar("DimsT", bound=Dims, covariant=True) ``` such that field type is as follows: ```python Field[Dims[D0, D1, ...], DType] ```
Variadic generic type:
such that field type is as follows: