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 — gh-126451: Register contextvars.Context to collections.abc.Mapping by tungol · Pull Request #126452 · python/cpython

Conversation

@tungol

@tungol tungol commented Nov 5, 2024 •
edited by bedevere-app Bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

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

  • Issue: register contextvars.Context to collections.abc.Mapping #126451

Sorry, something went wrong.

Uh oh!

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

All reactions
tungol added 2 commits November 5, 2024 11:31
@tungol
Register contextvars.Context to collections.abc.Mapping
74b3631
@tungol
test that all the methods are present
9c4e3f5
@tungol
tungol requested a review from 1st1 as a code owner November 5, 2024 19:47
@bedevere-app bedevere-app Bot added the awaiting review label Nov 5, 2024
@bedevere-app bedevere-app Bot mentioned this pull request Nov 5, 2024
register contextvars.Context to collections.abc.Mapping #126451
Closed
@tungol

tungol commented Nov 5, 2024

Copy link
Copy Markdown
Contributor Author

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

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

sobolevn
sobolevn reviewed Nov 5, 2024
View reviewed changes
Comment thread Lib/test/test_context.py Resolved

Uh oh!

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

tungol added 2 commits November 5, 2024 12:37
@tungol
test for callability, sort methods alphabetically in the test
3a1f8b2
@tungol
minor spacing
8c68b5b
sobolevn
sobolevn reviewed Nov 5, 2024
View reviewed changes

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

Thank you!

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread Misc/NEWS.d/next/Library/2024-11-05-11-28-45.gh-issue-126451.XJMtqz.rst Resolved

Uh oh!

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

@tungol @sobolevn
Update Misc/NEWS.d/next/Library/2024-11-05-11-28-45.gh-issue-126451.X…
aa0da03
…JMtqz.rst

Co-authored-by: sobolevn <[email protected]>
AlexWaygood
AlexWaygood reviewed Nov 5, 2024
View reviewed changes
Comment thread Lib/contextvars.py Resolved

Uh oh!

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

@tungol @AlexWaygood
import _collections_abc instead of collections.abc
72d6726
Co-authored-by: Alex Waygood <[email protected]>
AlexWaygood
AlexWaygood reviewed Nov 5, 2024
View reviewed changes
Comment thread Lib/test/test_context.py Resolved

Uh oh!

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

@tungol @AlexWaygood
use subtests
b0c38e8
Co-authored-by: Alex Waygood <[email protected]>
AlexWaygood
AlexWaygood approved these changes Nov 5, 2024
View reviewed changes
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting review labels Nov 5, 2024
sobolevn
sobolevn approved these changes Nov 6, 2024
View reviewed changes
kumaraditya303
kumaraditya303 reviewed Nov 6, 2024
View reviewed changes
Comment thread Lib/test/test_context.py Resolved

Uh oh!

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

@AlexWaygood AlexWaygood added needs backport to 3.12 only security fixes needs backport to 3.13 only security fixes labels Nov 6, 2024
ZeroIntensity
ZeroIntensity approved these changes Nov 6, 2024
View reviewed changes

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

Sorry, something went wrong.

Uh oh!

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

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

Uh oh!

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

tungol and others added 3 commits November 6, 2024 09:40
@tungol @ZeroIntensity
add issubclass check
96e2280
Co-authored-by: Peter Bierma <[email protected]>
@tungol @ZeroIntensity
Update Lib/test/test_context.py
5cdad6a
Co-authored-by: Peter Bierma <[email protected]>
@tungol
fix duplicate line
0e0a5e6
@sobolevn
sobolevn merged commit 5dc36dc into python:main Nov 6, 2024
@miss-islington-app

miss-islington-app Bot commented Nov 6, 2024

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

All reactions

Sorry, something went wrong.

Uh oh!

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

@bedevere-app bedevere-app Bot removed the awaiting merge label Nov 6, 2024
@sobolevn

sobolevn commented Nov 6, 2024

Copy link
Copy Markdown
Member

Thanks everyone!

All reactions

Sorry, something went wrong.

Uh oh!

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

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 6, 2024
@tungol @sobolevn
@AlexWaygood @ZeroIntensity @miss-islington
pythongh-126451: Register contextvars.Context to collections.abc.Mapp…
a307416
…ing (pythonGH-126452)

(cherry picked from commit 5dc36dc)

Co-authored-by: Stephen Morton <[email protected]>
Co-authored-by: sobolevn <[email protected]>
Co-authored-by: Alex Waygood <[email protected]>
Co-authored-by: Peter Bierma <[email protected]>
@sobolevn sobolevn removed needs backport to 3.12 only security fixes needs backport to 3.13 only security fixes labels Nov 6, 2024
@bedevere-app

bedevere-app Bot commented Nov 6, 2024

Copy link
Copy Markdown

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

All reactions

Sorry, something went wrong.

Uh oh!

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

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 6, 2024
@tungol @sobolevn
@AlexWaygood @ZeroIntensity @miss-islington
pythongh-126451: Register contextvars.Context to collections.abc.Mapp…
eec74ce
…ing (pythonGH-126452)

(cherry picked from commit 5dc36dc)

Co-authored-by: Stephen Morton <[email protected]>
Co-authored-by: sobolevn <[email protected]>
Co-authored-by: Alex Waygood <[email protected]>
Co-authored-by: Peter Bierma <[email protected]>
@bedevere-app

bedevere-app Bot commented Nov 6, 2024

Copy link
Copy Markdown

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

All reactions

Sorry, something went wrong.

Uh oh!

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

@sobolevn

sobolevn commented Nov 6, 2024 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

Should we really backport this?

All reactions

Sorry, something went wrong.

Uh oh!

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

@AlexWaygood

AlexWaygood commented Nov 6, 2024

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.

All reactions

Sorry, something went wrong.

Uh oh!

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

@sobolevn

sobolevn commented Nov 6, 2024

Copy link
Copy Markdown
Member

Let's be consistent with #126419 👍

AlexWaygood and ZeroIntensity reacted with thumbs up emoji
All reactions
  • 👍 2 reactions

Sorry, something went wrong.

Uh oh!

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

sobolevn added a commit that referenced this pull request Nov 6, 2024
@miss-islington @tungol
@sobolevn @AlexWaygood @ZeroIntensity
[3.12] gh-126451: Register contextvars.Context to collections.abc.Map…
d71da0f
…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 <[email protected]>
Co-authored-by: sobolevn <[email protected]>
Co-authored-by: Alex Waygood <[email protected]>
Co-authored-by: Peter Bierma <[email protected]>
sobolevn added a commit that referenced this pull request Nov 6, 2024
@miss-islington @tungol
@sobolevn @AlexWaygood @ZeroIntensity
[3.13] gh-126451: Register contextvars.Context to collections.abc.Map…
59316a6
…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 <[email protected]>
Co-authored-by: sobolevn <[email protected]>
Co-authored-by: Alex Waygood <[email protected]>
Co-authored-by: Peter Bierma <[email protected]>
@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
Revert "[3.13] pythongh-126451: Register contextvars.Context to colle…
9705e20
…ctions.abc.Mapping (pythonGH-126452) (python#126518)"

This reverts commit 59316a6.
@AlexWaygood AlexWaygood mentioned this pull request Nov 12, 2024
[3.13] gh-126451: Revert backports of ABC registrations for contextvars.Context and multiprocessing proxies #126734
Merged
AlexWaygood added a commit to AlexWaygood/cpython that referenced this pull request Nov 12, 2024
@AlexWaygood
Revert "[3.12] pythongh-126451: Register contextvars.Context to colle…
49d69f2
…ctions.abc.Mapping (pythonGH-126452) (python#126519)"

This reverts commit d71da0f.
@AlexWaygood AlexWaygood mentioned this pull request Nov 12, 2024
[3.12] gh-126451: Revert backports of ABC registrations for contextvars.Context and multiprocessing proxies #126735
Merged
picnixz pushed a commit to picnixz/cpython that referenced this pull request Dec 8, 2024
@tungol @sobolevn
@AlexWaygood @ZeroIntensity @picnixz
pythongh-126451: Register contextvars.Context to collections.abc.Mapp…
ba95f15
…ing (python#126452)

Co-authored-by: sobolevn <[email protected]>
Co-authored-by: Alex Waygood <[email protected]>
Co-authored-by: Peter Bierma <[email protected]>
ebonnal pushed a commit to ebonnal/cpython that referenced this pull request Jan 12, 2025
@tungol @sobolevn
@AlexWaygood @ZeroIntensity @ebonnal
pythongh-126451: Register contextvars.Context to collections.abc.Mapp…
41a38f5
…ing (python#126452)

Co-authored-by: sobolevn <[email protected]>
Co-authored-by: Alex Waygood <[email protected]>
Co-authored-by: Peter Bierma <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@kumaraditya303 kumaraditya303 kumaraditya303 left review comments
@AlexWaygood AlexWaygood AlexWaygood approved these changes
@sobolevn sobolevn sobolevn approved these changes
@ZeroIntensity ZeroIntensity ZeroIntensity approved these changes
@1st1 1st1 Awaiting requested review from 1st1 1st1 is a code owner

Uh oh!

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

Assignees

No one assigned

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.

5 participants

@tungol @sobolevn @AlexWaygood @ZeroIntensity @kumaraditya303
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.