Skip to content

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

Merged
AlexWaygood merged 13 commits into
python:mainfrom
sobolevn:issue-112281
Mar 1, 2024
Merged

gh-112281: Allow Union with unhashable Annotated metadata#112283
AlexWaygood merged 13 commits into
python:mainfrom
sobolevn:issue-112281

Conversation

@sobolevn

@sobolevnsobolevn commented Nov 20, 2023

Copy link
Copy Markdown
Member

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)

Comment threadLib/typing.py Outdated
Comment threadLib/test/test_typing.py Outdated
Comment threadLib/typing.py Outdated
Comment threadLib/typing.py Outdated
Comment threadLib/test/test_typing.py
Comment threadLib/test/test_typing.py Outdated
Comment threadMisc/NEWS.d/next/Library/2023-11-20-16-15-44.gh-issue-112281.gH4EVk.rst Outdated
Comment threadLib/typing.py Outdated
Comment threadLib/typing.py Outdated
Comment threadLib/typing.py Outdated
Comment threadLib/test/test_typing.py Outdated
Comment threadLib/test/test_types.py Outdated
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Comment threadLib/test/test_typing.py Outdated
Comment threadLib/test/test_typing.py Outdated
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
@sobolevn

Copy link
Copy Markdown
MemberAuthor

We just did 6 rounds of nitpicks :)

@AlexWaygoodAlexWaygood 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. @JelleZijlstra, anything more from you?

Comment threadLib/test/test_typing.py Outdated
sobolevnand others added 2 commits December 2, 2023 18:05
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
@AlexWaygood

Copy link
Copy Markdown
Member

I already approved this one :)

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

Copy link
Copy Markdown
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
Copy Markdown
Member

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

Yeah, agreed

@AlexWaygoodAlexWaygood added needs backport to 3.11 only security fixes needs backport to 3.12 only security fixes labels Mar 1, 2024
@AlexWaygood
AlexWaygood enabled auto-merge (squash) March 1, 2024 15:46
@AlexWaygood
AlexWaygood merged commit a7549b0 into python:mainMar 1, 2024
@miss-islington-app

Copy link
Copy Markdown

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
Copy Markdown

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
Copy Markdown

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

@bedevere-appbedevere-appBot removed the needs backport to 3.12 only 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>
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
Copy Markdown

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

@bedevere-appbedevere-appBot 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 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.

4 participants

@sobolevn@AlexWaygood@JelleZijlstra@faph