-
-
Notifications
You must be signed in to change notification settings - Fork 30.6k
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
register contextvars.Context to collections.abc.Mapping #126451
Comments
Could you list out all the methods on Mapping to confirm it really conforms with the interface? I'd like to prevent another case similar to #125420. |
Sure. Mapping methods are:
|
…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>
…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>
…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>
…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>
…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>
I was surprised that we backported this |
I was too :) |
The decision to backport is on me -- I applied the backport labels to both PRs. But I also don't feel strongly, and am fine with the backports being reverted if you disagree with them! FWIW, my thinking was:
But as I said in #126419 (comment), it feels very borderline to me, so I'm very happy to revert the backports if others disagree! |
The risky aspect to me is that |
As the person who kicked this off: I have no opinion about the backports. |
Thanks everybody for voicing your concerns! I appreciate it. |
…ctions.abc.Mapping (pythonGH-126452) (python#126518)" This reverts commit 59316a6.
…ctions.abc.Mapping (pythonGH-126452) (python#126519)" This reverts commit d71da0f.
…rs.Context and multiprocessing proxies (#126735)
…ars.Context` and multiprocessing proxies (#126734)
Feature or enhancement
Proposal:
contextvars.Context
is documented as implementing the collections.abc.Mapping interface. I believe we should register it to the abc, so anisinstance
check can work.This is similar to #126417 .
Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
Links to previous discussion of this feature:
A small amount of prior discussion occurred in an issue for typeshed: python/typeshed#12873
Linked PRs
contextvars.Context
and multiprocessing proxies #126734The text was updated successfully, but these errors were encountered: