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
Calling super().__init__ in subclasses of typing.Protocol raises RecursionError #89284
Comments
Consider:
This code passes without error on 3.9.6. With 3.9.7, we get:
I bisected this to: bpo-44806: Fix __init__ in subclasses of protocols (GH-27545) (GH-27559) Note there is also an interaction with the later commit: bpo-45081: Fix __init__ method generation when inheriting from Protocol (GH-28121) (GH-28132) This later commit actually causes a RecursionError:
Originally reported by @tyralla on Gitter. |
Possibly related to bpo-45081, which ended up not having anything to do with dataclasses (despite the title). Can you check if that fix solves your problem? |
As I mentioned in the post, bpo-45081 actually makes this issue worse, since we get a RecursionError. I think |
Sorry I didn't notice your reference to bpo-45081. |
Pablo, marking as release blocker. PR #72419 is merged to 3.10. It should be cherry-picked for 3.10.0 inclusion. |
Done! |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: