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-124872: Refine contextvars documentation #124773

Merged
merged 1 commit into from
Oct 9, 2024

Conversation

rhansen
Copy link
Contributor

@rhansen rhansen commented Sep 29, 2024

  • Add definitions for "context", "current context", and "context management protocol".
  • Update related definitions to be consistent with the new definitions.
  • Restructure the documentation for the contextvars.Context class to prepare for adding context manager support, and for consistency with the definitions.
  • Use testcode and testoutput to test the Context.run example.
  • Expand the documentation for the Py_CONTEXT_EVENT_ENTER and Py_CONTEXT_EVENT_EXIT events to clarify and to prepare for planned changes.

cc @fried


📚 Documentation preview 📚: https://cpython-previews--124773.org.readthedocs.build/

  * Add definitions for "context", "current context", and "context
    management protocol".
  * Update related definitions to be consistent with the new
    definitions.
  * Restructure the documentation for the `contextvars.Context` class
    to prepare for adding context manager support, and for consistency
    with the definitions.
  * Use `testcode` and `testoutput` to test the `Context.run` example.
  * Expand the documentation for the `Py_CONTEXT_EVENT_ENTER` and
    `Py_CONTEXT_EVENT_EXIT` events to clarify and to prepare for
    planned changes.
@rhansen rhansen force-pushed the gh-119333-99633-docs branch from b16f493 to c38c1c6 Compare October 1, 2024 23:23
@rhansen rhansen changed the title gh-119333, gh-99633: Refine contextvars documentation gh-124872: Refine contextvars documentation Oct 1, 2024
Copy link
Member

@1st1 1st1 left a comment

Choose a reason for hiding this comment

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

Excellent stuff. Thank you.

@1st1 1st1 added the 3.13 bugs and security fixes label Oct 9, 2024
@1st1 1st1 merged commit 9940093 into python:main Oct 9, 2024
40 checks passed
@bswck
Copy link
Contributor

bswck commented Oct 10, 2024

Huge +1.

@1st1 1st1 added the needs backport to 3.13 bugs and security fixes label Oct 10, 2024
@miss-islington-app
Copy link

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

@miss-islington-app
Copy link

Sorry, @rhansen and @1st1, I could not cleanly backport this to 3.13 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 99400930ac1d4e5e10a5ae30f8202d8bc2661e39 3.13

@1st1
Copy link
Member

1st1 commented Oct 10, 2024

@rhansen can you submit a PR against 3.13 please?

@bedevere-app
Copy link

bedevere-app bot commented Oct 10, 2024

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

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Oct 10, 2024
@rhansen rhansen deleted the gh-119333-99633-docs branch October 10, 2024 07:06
rhansen added a commit to rhansen/cpython that referenced this pull request Oct 10, 2024
I opened issue pythongh-124872 after creating PR pythongh-124773 but forgot to
rename the blurb file to match the new issue number.  (The cherry-pick
to 3.13 in pythongh-125233 already uses this new filename.)
willingc added a commit that referenced this pull request Oct 30, 2024
[3.13] gh-124872: Refine contextvars documentation

  * Add definitions for "context", "current context", and "context
    management protocol".
  * Update related definitions to be consistent with the new
    definitions.
  * Restructure the documentation for the `contextvars.Context` class
    to prepare for adding context manager support, and for consistency
    with the definitions.
  * Use `testcode` and `testoutput` to test the `Context.run` example.

(cherry-picked from commit 9940093)

Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.13 bugs and security fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants