-
Notifications
You must be signed in to change notification settings - Fork 47
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
ClassVar parameters cannot include any type variables #565
Comments
I was not really aware of the PEP-526 restriction on ClassVars and it looks like most of the static type checker tools weren't either until very recently ( microsoft/pyright#2567, python/mypy#11538, python/typeshed#6333 ). I think the solution for this specific case is relatively straightforward: change the definition of |
Yeah, I caught it by putting gt4py through
Sounds good. |
Major changes: - Adds type checking on a few more files. - Expr.dtype's type is no longer Optional[DataType], because that caused type havoc. Therefore, the default is changed from None to DataType.AUTO when not set explicitly. The gtir_dtype_resolver and other visitors are updated to check for DataType.AUTO instead of None. - Moves most of the code that was in eve.iterators to eve.concepts to work around a circular dependency after solving ClassVar parameters cannot include any type variables #565 using @egparedes's suggestion. This is a temporary workaround until we replace Eve with the new version. - gt4py.stencil_object.ArgsInfo is made non-private and used in gt4py.dace_stencil_object to fix a type issue. - Ignores typing in eve visitor contexts -- need to fix that in a follow-up PR. - npir.HorizontalMask is created as a tuple of tuples, to avoid the Optional[AxisBound] in the common.HorizontalInterval type. - Replaces gt_backend references with gt4py.backend. Follows #978. Resolves #565. Resolves #992. Resolves #1007.
PEP-526 states that
Unfortunately the new
contexts
feature of theNodeVisitors
use this implicitly becauseeve.concepts.TreeNode = Union[AnyNode, CollectionNode]
andNeed to find a way around this or reimplement the feature.
cc: @egparedes
The text was updated successfully, but these errors were encountered: