Skip to content

bpo-38908: Fix issue when non runtime_protocol does not raise TypeError - #26067

Merged
gvanrossum merged 4 commits into
python:mainfrom
uriyyo:fix-issue-38908
May 12, 2021
Merged

bpo-38908: Fix issue when non runtime_protocol does not raise TypeError#26067
gvanrossum merged 4 commits into
python:mainfrom
uriyyo:fix-issue-38908

Conversation

@uriyyo

@uriyyouriyyo commented May 12, 2021

Copy link
Copy Markdown
Member

@Fidget-Spinner
Fidget-Spinner self-requested a review May 12, 2021 14:11
@uriyyouriyyo changed the title bpo-38908: Fix issue when non runtime_protocol does not raise TypeErrorbpo-38908: Add tests to cover case when non runtime_protocol does not raise TypeErrorMay 12, 2021

@Fidget-SpinnerFidget-Spinner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yurii, thanks for sending a PR to make sure there are no regressions for this long-standing issue!

Comment threadLib/test/test_typing.py Outdated
@uriyyouriyyo changed the title bpo-38908: Add tests to cover case when non runtime_protocol does not raise TypeErrorbpo-38908: Fix issue when non runtime_protocol does not raise TypeErrorMay 12, 2021
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
@uriyyo

Copy link
Copy Markdown
MemberAuthor

@Fidget-Spinner It is not regression, I made a mistake when said that this issue was not present at 3.11 version. This issue still present and this PR will fix it.

@Fidget-Spinner

Copy link
Copy Markdown
Member

@Fidget-Spinner It is not regression, I made a mistake when said that this issue was not present at 3.11 version. This issue still present and this PR will fix it.

Oh interesting! class P(Protocol): ... raises as expected, but

classP(Protocol): x : int

doesn't!

@Fidget-SpinnerFidget-Spinner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Once again, thank you for fixing this!

Comment threadMisc/NEWS.d/next/Library/2021-05-12-16-43-21.bpo-38908.nM2_rO.rst Outdated
Comment threadLib/typing.py
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>

@gvanrossumgvanrossum left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Does this need backporting?

@bedevere-bot

Copy link
Copy Markdown

@gvanrossum: Please replace # with GH- in the commit message next time. Thanks!

@miss-islington

Copy link
Copy Markdown
Contributor

Thanks @uriyyo for the PR, and @gvanrossum for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10, 3.9.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request May 12, 2021
…ror (pythonGH-26067)
(cherry picked from commit c40486a)
Co-authored-by: Yurii Karabas <1998uriyyo@gmail.com>
@bedevere-bot

Copy link
Copy Markdown

GH-26073 is a backport of this pull request to the 3.10 branch.

@bedevere-botbedevere-bot removed the needs backport to 3.10 only security fixes label May 12, 2021
@miss-islington

Copy link
Copy Markdown
Contributor

Sorry, @uriyyo and @gvanrossum, I could not cleanly backport this to 3.9 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker c40486a32d7e37b01ead94e701d69847f5b60e30 3.9

@Fidget-Spinner

Copy link
Copy Markdown
Member

Sorry, @uriyyo and @gvanrossum, I could not cleanly backport this to 3.9 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker c40486a32d7e37b01ead94e701d69847f5b60e30 3.9

I'm on it. It's clashing because the _allow_reckless_class_checks was previously _allow_reckless_class_cheks and the typo fix wasn't backported.

@bedevere-bot

Copy link
Copy Markdown

GH-26075 is a backport of this pull request to the 3.9 branch.

miss-islington added a commit that referenced this pull request May 12, 2021
…ror (GH-26067)
(cherry picked from commit c40486a)
Co-authored-by: Yurii Karabas <1998uriyyo@gmail.com>
miss-islington pushed a commit that referenced this pull request May 12, 2021
…ypeError (GH-26067) (GH-26075)
(cherry picked from commit c40486a)
Co-authored-by: Yurii Karabas 1998uriyyo@gmail.com
Automerge-Triggered-By: GH:gvanrossum
Fidget-Spinner added a commit to Fidget-Spinner/cpython that referenced this pull request May 12, 2021
miss-islington pushed a commit that referenced this pull request May 12, 2021
…es not raise TypeError (GH-26067)" (GH-26077)
Reverts #26075
Automerge-Triggered-By: GH:gvanrossum
srittau pushed a commit to python/typing_extensions that referenced this pull request Apr 12, 2023
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@uriyyo@Fidget-Spinner@bedevere-bot@miss-islington@gvanrossum@the-knights-who-say-ni