-
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
style[next]: more strict typing #1494
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.
I have some comments to improve the typing fixes.
src/gt4py/next/program_processors/codegens/gtfn/itir_to_gtfn_ir.py
Outdated
Show resolved
Hide resolved
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.
Looks good. Final round of questions before approving.
src/gt4py/next/embedded/operators.py
Outdated
@@ -46,7 +46,7 @@ def __call__( # type: ignore[override] | |||
self, | |||
*args: common.Field | core_defs.Scalar, | |||
**kwargs: common.Field | core_defs.Scalar, # type: ignore[override] | |||
) -> common.Field: | |||
) -> common.Field | tuple[common.Field | tuple, ...]: |
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.
Shouldn't this be something like :
) -> common.Field | tuple[common.Field | tuple, ...]: | |
) -> common.Field[Any, _R] | tuple[common.Field[Any, _R] | tuple, ...]: |
to bound the _R
typevar to this class?
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.
init
was missing the correct typevar and here it gets a bit more complicated, see solution.
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.
Some of the typing ignores in return types could also be solved using cast()
but it's not a big deal. ILGTM.
No description provided.