GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — bpo-38908: Fix issue when non runtime_protocol does not raise TypeError by uriyyo · Pull Request #26067 · python/cpython

Conversation

@uriyyo

@uriyyo uriyyo commented May 12, 2021 •
edited by bedevere-bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

https://bugs.python.org/issue38908

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@uriyyo
uriyyo requested review from gvanrossum and ilevkivskyi as code owners May 12, 2021 13:54
@bedevere-bot bedevere-bot added the awaiting review label May 12, 2021
@the-knights-who-say-ni the-knights-who-say-ni added the CLA signed label May 12, 2021
@uriyyo
Fix issue when non runtime_protocol does not raise TypeError
53d5008
@uriyyo
uriyyo force-pushed the fix-issue-38908 branch from ba9811d to 53d5008 Compare May 12, 2021 14:01
@Fidget-Spinner
Fidget-Spinner self-requested a review May 12, 2021 14:11
@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
Fidget-Spinner
Fidget-Spinner reviewed May 12, 2021
View reviewed changes

@Fidget-Spinner Fidget-Spinner left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

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!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Lib/test/test_typing.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@uriyyo
Fix test
179cb40
@uriyyo
uriyyo force-pushed the fix-issue-38908 branch from 9155670 to 179cb40 Compare May 12, 2021 14:29
@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
@uriyyo @Fidget-Spinner
Update Lib/test/test_typing.py
9c66ec3
Co-authored-by: Ken Jin <[email protected]>
@uriyyo

uriyyo commented May 12, 2021

Copy link
Copy Markdown
Member Author

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Fidget-Spinner

Fidget-Spinner commented May 12, 2021

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

class P(Protocol): 
    x : int

doesn't!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Fidget-Spinner Fidget-Spinner added needs backport to 3.9 labels May 12, 2021
Fidget-Spinner
Fidget-Spinner approved these changes May 12, 2021
View reviewed changes

@Fidget-Spinner Fidget-Spinner left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

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!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bedevere-bot bedevere-bot added awaiting core review and removed awaiting review labels May 12, 2021
Fidget-Spinner
Fidget-Spinner requested changes May 12, 2021
View reviewed changes
Comment thread Misc/NEWS.d/next/Library/2021-05-12-16-43-21.bpo-38908.nM2_rO.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/typing.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@uriyyo @Fidget-Spinner
Update Misc/NEWS.d/next/Library/2021-05-12-16-43-21.bpo-38908.nM2_rO.rst
d2baaba
Co-authored-by: Ken Jin <[email protected]>
Fidget-Spinner
Fidget-Spinner approved these changes May 12, 2021
View reviewed changes
gvanrossum
gvanrossum approved these changes May 12, 2021
View reviewed changes

@gvanrossum gvanrossum left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

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?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bedevere-bot bedevere-bot added awaiting merge and removed awaiting core review labels May 12, 2021
@gvanrossum
gvanrossum merged commit c40486a into python:main May 12, 2021
@bedevere-bot

bedevere-bot commented May 12, 2021

Copy link
Copy Markdown

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@miss-islington

miss-islington commented May 12, 2021

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.
🐍🍒⛏🤖

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot removed the awaiting merge label May 12, 2021
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request May 12, 2021
@uriyyo @miss-islington
bpo-38908: Fix issue when non runtime_protocol failed to raise TypeEr…
f5a4d3c
…ror (pythonGH-26067)

(cherry picked from commit c40486a)

Co-authored-by: Yurii Karabas <[email protected]>
@bedevere-bot

bedevere-bot commented May 12, 2021

Copy link
Copy Markdown

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

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

miss-islington commented May 12, 2021

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@miss-islington miss-islington assigned gvanrossum May 12, 2021
Fidget-Spinner pushed a commit to Fidget-Spinner/cpython that referenced this pull request May 12, 2021
@uriyyo @Fidget-Spinner
bpo-38908: Fix issue when non runtime_protocol failed to raise TypeEr…
a1bee7e
…ror (python#26067)
@Fidget-Spinner

Fidget-Spinner commented May 12, 2021

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.

uriyyo reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot removed the needs backport to 3.9 label May 12, 2021
@bedevere-bot

bedevere-bot commented May 12, 2021

Copy link
Copy Markdown

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

miss-islington added a commit that referenced this pull request May 12, 2021
@miss-islington @uriyyo
bpo-38908: Fix issue when non runtime_protocol failed to raise TypeEr…
a2d94a0
…ror (GH-26067)

(cherry picked from commit c40486a)

Co-authored-by: Yurii Karabas <[email protected]>
miss-islington pushed a commit that referenced this pull request May 12, 2021
@Fidget-Spinner
[3.9] bpo-38908: Fix issue when non runtime_protocol does not raise T…
88136bb
…ypeError (GH-26067) (GH-26075)

(cherry picked from commit c40486a)

Co-authored-by: Yurii Karabas [email protected]

Automerge-Triggered-By: GH:gvanrossum
Fidget-Spinner added a commit to Fidget-Spinner/cpython that referenced this pull request May 12, 2021
@Fidget-Spinner
Revert "[3.9] bpo-38908: Fix issue when non runtime_protocol does not…
3ea1c0b
… raise TypeError (pythonGH-26067) (pythonGH-26075)"

This reverts commit 88136bb.
miss-islington pushed a commit that referenced this pull request May 12, 2021
@Fidget-Spinner
[3.9] Revert "[3.9] bpo-38908: Fix issue when non runtime_protocol do…
9b90ce6
…es not raise TypeError (GH-26067)" (GH-26077)

Reverts #26075

Automerge-Triggered-By: GH:gvanrossum
@pablogsal pablogsal mentioned this pull request Jul 18, 2021
[3.10] Correct the order of regen-abidump #27228
Closed
@AlexWaygood AlexWaygood mentioned this pull request Apr 9, 2023
Backport CPython PR 26067 python/typing_extensions#132
Merged
srittau pushed a commit to python/typing_extensions that referenced this pull request Apr 12, 2023
@AlexWaygood
Fix issue when non runtime_protocol does not raise TypeError (#132)
7e998c2
Backport of CPython PR 26067 (python/cpython#26067)
This was referenced May 23, 2023
Clarify error message for non @runtime_checkable decorated protocols python/typing_extensions#178
Merged
fix(typing): add @runtime_checkable decorator for CustomTreeNode protocol class metaopt/optree#56
Merged
@GiaJordan GiaJordan mentioned this pull request May 25, 2023
Restrict typing-extensions package to versions before v4.6.0 Sage-Bionetworks/schematic#1228
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@gvanrossum gvanrossum gvanrossum approved these changes
@Fidget-Spinner Fidget-Spinner Fidget-Spinner approved these changes
@ilevkivskyi ilevkivskyi Awaiting requested review from ilevkivskyi

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@gvanrossum gvanrossum

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

6 participants

@uriyyo @Fidget-Spinner @bedevere-bot @miss-islington @gvanrossum @the-knights-who-say-ni
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.