-
Notifications
You must be signed in to change notification settings - Fork 258
Allow issubclass
for protocols with class variables
#822
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
Comments
That looks reasonable. Could you submit a PR? Does this need changing in mypy too? |
I do not think this needs to change in mypy, as the problem is using |
Maybe a project for @Fidget-Spinner? This would be a new feature in 3.11. |
Sure, I'll take a shot at this. Currently I'm a little busy with other things in CPython, so I might not be able to work on this immediately. We're not in a hurry (yet), 3.11's first alpha is in October 2021, and beta freeze in April 2022. |
@gvanrossum @Fidget-Spinner I can help with this feature if you need help. I am familiar with |
@uriyyo sorry, I'm working on this. I will tell you if I need any help. |
@Fidget-Spinner Great, I am waiting to see your implementation) |
PR for CPython is open at python/cpython#27883. Once that is merged, we can downstream it to |
Currently
issubclass
cannot be used forruntime_checkable
protocols with data members, because those attributes could be set in__init__
. I propose to relax this restriction to allow protocols withClassVar
members, as those should be present in the class definition.The text was updated successfully, but these errors were encountered: