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

gh-112281: Allow Union with unhashable Annotated metadata #112283

Merged
merged 13 commits into from
Mar 1, 2024

Conversation

sobolevn
Copy link
Member

@sobolevn sobolevn commented Nov 20, 2023

This should not affect performance that much:

  1. I tried to keep the fast path as it is
  2. Slow path is only used when TypeError happens on unhashable items (it should not affect code with only hashable parts)

Lib/typing.py Outdated Show resolved Hide resolved
Lib/typing.py Outdated Show resolved Hide resolved
Lib/typing.py Outdated Show resolved Hide resolved
Lib/test/test_typing.py Show resolved Hide resolved
Lib/test/test_typing.py Outdated Show resolved Hide resolved
Lib/typing.py Outdated Show resolved Hide resolved
Lib/typing.py Outdated Show resolved Hide resolved
Lib/typing.py Outdated Show resolved Hide resolved
Lib/test/test_typing.py Outdated Show resolved Hide resolved
Lib/test/test_types.py Outdated Show resolved Hide resolved
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Lib/test/test_typing.py Outdated Show resolved Hide resolved
Lib/test/test_typing.py Outdated Show resolved Hide resolved
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
@sobolevn
Copy link
Member Author

sobolevn commented Dec 2, 2023

We just did 6 rounds of nitpicks :)

Copy link
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

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

LGTM. @JelleZijlstra, anything more from you?

Lib/test/test_typing.py Outdated Show resolved Hide resolved
sobolevn and others added 2 commits December 2, 2023 18:05
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
@AlexWaygood
Copy link
Member

I already approved this one :)

@AlexWaygood AlexWaygood removed their request for review February 7, 2024 12:48
@JelleZijlstra
Copy link
Member

Thanks, and sorry for the wait!

Do you think this should be backported? I lean yes because the old behavior feels like a bug.

@AlexWaygood
Copy link
Member

Do you think this should be backported? I lean yes because the old behavior feels like a bug.

Yeah, agreed

@AlexWaygood AlexWaygood added needs backport to 3.11 only security fixes needs backport to 3.12 bug and security fixes labels Mar 1, 2024
@AlexWaygood AlexWaygood enabled auto-merge (squash) March 1, 2024 15:46
@AlexWaygood AlexWaygood merged commit a7549b0 into python:main Mar 1, 2024
31 checks passed
@miss-islington-app
Copy link

Thanks @sobolevn for the PR, and @AlexWaygood for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Mar 1, 2024
…ythonGH-112283)

(cherry picked from commit a7549b0)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
@miss-islington-app
Copy link

Sorry, @sobolevn and @AlexWaygood, I could not cleanly backport this to 3.11 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker a7549b03cec1699b5342cddf292c179315433fa2 3.11

@bedevere-app
Copy link

bedevere-app bot commented Mar 1, 2024

GH-116213 is a backport of this pull request to the 3.12 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.12 bug and security fixes label Mar 1, 2024
AlexWaygood added a commit that referenced this pull request Mar 1, 2024
…H-112283) (#116213)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
@AlexWaygood AlexWaygood assigned sobolevn and unassigned AlexWaygood Mar 1, 2024
sobolevn added a commit to sobolevn/cpython that referenced this pull request Mar 3, 2024
…adata (pythonGH-112283)

(cherry picked from commit a7549b0)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
@bedevere-app
Copy link

bedevere-app bot commented Mar 3, 2024

GH-116288 is a backport of this pull request to the 3.11 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.11 only security fixes label Mar 3, 2024
AlexWaygood added a commit that referenced this pull request Mar 3, 2024
…H-112283) (#116288)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
woodruffw pushed a commit to woodruffw-forks/cpython that referenced this pull request Mar 4, 2024
…ython#112283)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
adorilson pushed a commit to adorilson/cpython that referenced this pull request Mar 25, 2024
…ython#112283)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
diegorusso pushed a commit to diegorusso/cpython that referenced this pull request Apr 17, 2024
…ython#112283)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Sign up for free to 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.

4 participants