bpo-38908: Fix issue when non runtime_protocol does not raise TypeError by uriyyo · Pull Request #26067 · python/cpython

@uriyyo

@uriyyo

@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

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!

@uriyyo

@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

Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>

@uriyyo

@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

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

Fidget-Spinner

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!

Fidget-Spinner

@uriyyo @Fidget-Spinner

Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>

Fidget-Spinner

gvanrossum

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

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

@miss-islington

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

@miss-islington

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 pushed a commit to Fidget-Spinner/cpython that referenced this pull request

May 12, 2021

@uriyyo @Fidget-Spinner

@Fidget-Spinner

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

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

srittau pushed a commit to python/typing_extensions that referenced this pull request

Apr 12, 2023

This was referenced

May 23, 2023