Skip to content

gh-126451: Register contextvars.Context to collections.abc.Mapping - #126452

Merged
sobolevn merged 10 commits into
python:mainfrom
tungol:contextvars-abc
Nov 6, 2024
Merged

gh-126451: Register contextvars.Context to collections.abc.Mapping#126452
sobolevn merged 10 commits into
python:mainfrom
tungol:contextvars-abc

Conversation

@tungol

@tungoltungol commented Nov 5, 2024

Copy link
Copy Markdown
Contributor

This MR registers contextvars.Context to collections.abc.Mapping. It's already documented that Context implements the Mapping interface.

@tungol

Copy link
Copy Markdown
ContributorAuthor

The test failure doesn't reproduce locally for me, and I'm not sure how my MR is related. I'm open to suggestions.

Comment threadLib/test/test_context.py Outdated

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

Thank you!

Comment threadMisc/NEWS.d/next/Library/2024-11-05-11-28-45.gh-issue-126451.XJMtqz.rst Outdated
…JMtqz.rst
Co-authored-by: sobolevn <mail@sobolevn.me>
Comment threadLib/contextvars.py Outdated
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Comment threadLib/test/test_context.py Outdated
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Comment threadLib/test/test_context.py
@AlexWaygoodAlexWaygood added needs backport to 3.12 only security fixes needs backport to 3.13 bugs and security fixes labels Nov 6, 2024

@ZeroIntensityZeroIntensity 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, with one extra nitpick about adding an issubclass check to the test.

Comment threadLib/test/test_context.py
tungoland others added 3 commits November 6, 2024 09:40
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
@sobolevn
sobolevn merged commit 5dc36dc into python:mainNov 6, 2024
@miss-islington-app

Copy link
Copy Markdown

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

@sobolevn

Copy link
Copy Markdown
Member

Thanks everyone!

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 6, 2024
…ing (pythonGH-126452)
(cherry picked from commit 5dc36dc)
Co-authored-by: Stephen Morton <git@tungol.org>
Co-authored-by: sobolevn <mail@sobolevn.me>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
@sobolevnsobolevn removed needs backport to 3.12 only security fixes needs backport to 3.13 bugs and security fixes labels Nov 6, 2024
@bedevere-app

Copy link
Copy Markdown

GH-126518 is a backport of this pull request to the 3.13 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 6, 2024
…ing (pythonGH-126452)
(cherry picked from commit 5dc36dc)
Co-authored-by: Stephen Morton <git@tungol.org>
Co-authored-by: sobolevn <mail@sobolevn.me>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
@bedevere-app

Copy link
Copy Markdown

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

@sobolevn

sobolevn commented Nov 6, 2024

Copy link
Copy Markdown
Member

Should we really backport this?

@AlexWaygood

Copy link
Copy Markdown
Member

We backported #126419 (see discussion in that PR). But I agree it's borderline; I don't feel strongly! Feel free to close the backports if you'd rather not.

@sobolevn

Copy link
Copy Markdown
Member

Let's be consistent with #126419 👍

sobolevn added a commit that referenced this pull request Nov 6, 2024
…ping (GH-126452) (#126519)
gh-126451: Register contextvars.Context to collections.abc.Mapping (GH-126452)
(cherry picked from commit 5dc36dc)
Co-authored-by: Stephen Morton <git@tungol.org>
Co-authored-by: sobolevn <mail@sobolevn.me>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
sobolevn added a commit that referenced this pull request Nov 6, 2024
…ping (GH-126452) (#126518)
gh-126451: Register contextvars.Context to collections.abc.Mapping (GH-126452)
(cherry picked from commit 5dc36dc)
Co-authored-by: Stephen Morton <git@tungol.org>
Co-authored-by: sobolevn <mail@sobolevn.me>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
@tungol
tungol deleted the contextvars-abc branch November 6, 2024 22:43
AlexWaygood added a commit to AlexWaygood/cpython that referenced this pull request Nov 12, 2024
AlexWaygood added a commit to AlexWaygood/cpython that referenced this pull request Nov 12, 2024
picnixz pushed a commit to picnixz/cpython that referenced this pull request Dec 8, 2024
…ing (python#126452)
Co-authored-by: sobolevn <mail@sobolevn.me>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
ebonnal pushed a commit to ebonnal/cpython that referenced this pull request Jan 12, 2025
…ing (python#126452)
Co-authored-by: sobolevn <mail@sobolevn.me>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Peter Bierma <zintensitydev@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.

5 participants

@tungol@sobolevn@AlexWaygood@ZeroIntensity@kumaraditya303