8000 Protocol parameter invalid in typing_extensions==4.6 · Issue #201 · astropenguin/xarray-dataclasses · GitHub
[go: up one dir, main page]

Skip to content

Protocol parameter invalid in typing_extensions==4.6 #201

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

Closed
giovp opened this issue May 23, 2023 · 2 comments
Closed

Protocol parameter invalid in typing_extensions==4.6 #201

giovp opened this issue May 23, 2023 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@giovp
Copy link
giovp commented May 23, 2023

with python 3.10 and typing_extensions 4.6 I get this error

.tox/py310-linux/lib/python3.10/site-packages/xarray_dataclasses/typing.py:74: in <module>
      class DataClass(Protocol[PInit]):
  /opt/hostedtoolcache/Python/3.10.11/x64/lib/python3.10/typing.py:312: in inner
      return func(*args, **kwds)
  .tox/py310-linux/lib/python3.10/site-packages/typing_extensions.py:672: in __class_getitem__
      raise TypeError(
  E   TypeError: Parameters to Protocol[...] must all be type variables. Parameter 1 is ~PInit

referred to this line

class DataClass(Protocol[PInit]):

@astropenguin astropenguin added the bug Something isn't working label May 29, 2023
@astropenguin
Copy link
Owner
astropenguin commented Jun 2, 2023

Dear @giovp , thank you for reporting this issue. It seems that it is a bug related to typing_extension v4.6.0 (python/typing_extensions#181), not to our side. Now they released the bug-fixed version (v4.6.1) and I confirmed that it works without the error (at least in my environment). So could you try to update typing_extension?

@astropenguin astropenguin self-assigned this Jun 2, 2023
@giovp
Copy link
Author
giovp commented Jun 22, 2023

it works, thanks a lot!

@giovp giovp closed this as completed Jun 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants
0