-
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
feature[next]: support for Python 3.11 #1407
Conversation
src/gt4py/eve/datamodels/core.py
Outdated
namespace = { | ||
"__annotations__": new_annotations, | ||
"__module__": module if module else datamodel_cls.__module__, | ||
"__bound_type_params__": bound_type_params, # TODO(havogt) is this useful information? |
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.
not sure if it's useful to store this, it allows to do the check above
src/gt4py/eve/datamodels/core.py
Outdated
@@ -971,6 +971,14 @@ def __pretty__( | |||
return __pretty__ | |||
|
|||
|
|||
def _is_concrete_data_model( | |||
cls: Type, type_args: Tuple[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.
if cls: Type
, we need to do more checks inside, try again Type[GenericDataModelT]
src/gt4py/eve/type_validation.py
Outdated
@@ -358,6 +358,8 @@ def make_is_instance_of(name: str, type_: type) -> FixedTypeValidator: | |||
"""Create an ``FixedTypeValidator`` validator for a specific type.""" | |||
|
|||
def _is_instance_of(value: Any, **kwargs: Any) -> None: | |||
if type_ is Any: |
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.
possibly tests are wrong
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.
The actual reason for this was actually a bug in a previous fix for dealing with the implementation of typing.Any
as a type in modern python & typing_extensions versions. I removed this fix and applied the proper bug fix in extended_typing
.
@havogt could you take a look to my changes? Should we open a new PR for you being able to review it? |
Please open a new PR, I don't always want to get github credit for your work. ;) |
Closing in favor of #1418 |
Fixes hidden bugs in datamodels and extended_typing to support Python 3.11.
Actual bug fixes:
typing.Any
implementation as a class (python/cpython@5a4973e) didn't work in 3.11.Other changes: