Visitar URL original
bpo-38908: Fix issue when non runtime_protocol does not raise TypeError by uriyyo · Pull Request #26067 · python/cpython · GitHub
The Wayback Machine - https://web.archive.org/web/20220202234403/https://github.com/python/cpython/pull/26067
Skip to content
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

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

Merged
merged 4 commits into from May 12, 2021

Conversation

@uriyyo
Copy link
Member

@uriyyo uriyyo commented May 12, 2021 •

https://bugs.python.org/issue38908

@uriyyo uriyyo force-pushed the fix-issue-38908 branch from ba9811d to 53d5008 May 12, 2021
@Fidget-Spinner Fidget-Spinner self-requested a review May 12, 2021
@uriyyo uriyyo changed the title bpo-38908: Fix issue when non runtime_protocol does not raise TypeError bpo-38908: Add tests to cover case when non runtime_protocol does not raise TypeError May 12, 2021
Copy link
Contributor

@Fidget-Spinner Fidget-Spinner left a comment

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

Lib/test/test_typing.py Outdated Show resolved Hide resolved
@uriyyo uriyyo force-pushed the fix-issue-38908 branch from 9155670 to 179cb40 May 12, 2021
@uriyyo uriyyo changed the title bpo-38908: Add tests to cover case when non runtime_protocol does not raise TypeError bpo-38908: Fix issue when non runtime_protocol does not raise TypeError May 12, 2021
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
@uriyyo
Copy link
Member Author

@uriyyo uriyyo commented May 12, 2021

@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
Contributor

@Fidget-Spinner Fidget-Spinner commented May 12, 2021

@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

class P(Protocol): 
    x : int

doesn't!

Copy link
Contributor

@Fidget-Spinner Fidget-Spinner left a comment

LGTM. Once again, thank you for fixing this!

Lib/typing.py Show resolved Hide resolved
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
Copy link
Member

@gvanrossum gvanrossum left a comment

Thanks! Does this need backporting?

@gvanrossum gvanrossum merged commit c40486a into python:main May 12, 2021
12 checks passed
@bedevere-bot
Copy link

@bedevere-bot bedevere-bot commented May 12, 2021

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

@miss-islington
Copy link
Contributor

@miss-islington miss-islington commented May 12, 2021

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 added a commit to miss-islington/cpython that referenced this issue May 12, 2021
…ror (pythonGH-26067)

(cherry picked from commit c40486a)

Co-authored-by: Yurii Karabas <1998uriyyo@gmail.com>
@bedevere-bot
Copy link

@bedevere-bot bedevere-bot commented May 12, 2021

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

@miss-islington
Copy link
Contributor

@miss-islington miss-islington commented May 12, 2021

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
Contributor

@Fidget-Spinner Fidget-Spinner commented May 12, 2021

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

@bedevere-bot bedevere-bot commented May 12, 2021

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

miss-islington added a commit that referenced this issue 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 issue 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 issue May 12, 2021
miss-islington pushed a commit that referenced this issue May 12, 2021
…es not raise TypeError (GH-26067)" (GH-26077)

Reverts #26075

Automerge-Triggered-By: GH:gvanrossum
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants