Uh oh!
There was an error while loading. Please reload this page.
bpo-45081: Fix __init__ method generation when inheriting from Protocol - #28121
Conversation
uriyyo
commented
Sep 2, 2021
@Fidget-Spinner Could you please verify that we need backport those changes to 3.9 and 3.10 versions? |
Uh oh!
There was an error while loading. Please reload this page.
Fidget-Spinner
left a comment
There was a problem hiding this comment.
@uriyyo if I understand the original issue correctly, you're right that we need to backport this to fix that issue's backports.
I'm deferring this to @serhiy-storchaka or @ambv because I'm not too familiar with the previous patch that caused this regression. Sorry.
Uh oh!
There was an error while loading. Please reload this page.
uriyyo
commented
Sep 2, 2021
@Fidget-Spinner Could you please review this PR? Looks like I found way how to fix this issue without changing |
Fidget-Spinner
left a comment
There was a problem hiding this comment.
After researching this issue (and the previous patch), this LGTM in general, I only have suggestions to change wording in some parts.
I'm not very confident with backporting this change so late into 3.10's release cycle. I hope another core dev can review.
| cls = type(self) | ||
| if cls._is_protocol: | ||
| raise TypeError('Protocols cannot be instantiated') |
There was a problem hiding this comment.
Note to self: this is the previous behavior.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
ambv
commented
Sep 2, 2021
The previous behavior was introduced in GH-27545 as an attempt to make non-protocol subclasses of Protocol ignore the This PR retains this ability and restores compatibility with |
miss-islington
commented
Sep 2, 2021
…ol (pythonGH-28121) Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com> (cherry picked from commit 0635e20) Co-authored-by: Yurii Karabas <1998uriyyo@gmail.com>
bedevere-bot
commented
Sep 2, 2021
GH-28131 is a backport of this pull request to the 3.10 branch. |
bedevere-bot
commented
Sep 2, 2021
GH-28132 is a backport of this pull request to the 3.9 branch. |
…ol (pythonGH-28121) Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com> (cherry picked from commit 0635e20) Co-authored-by: Yurii Karabas <1998uriyyo@gmail.com>
https://bugs.python.org/issue45081