Skip to content

Conversation

@rhansen
Copy link
Contributor

@rhansenrhansen 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.
@rhansenrhansenforce-pushed the gh-119333-99633-docs branch from b16f493 to c38c1c6CompareOctober 1, 2024 23:23
@rhansenrhansen changed the title gh-119333, gh-99633: Refine contextvars documentationgh-124872: Refine contextvars documentationOct 1, 2024
1st1
1st1 approved these changes Oct 9, 2024
Copy link
Member

@1st11st1 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.

@1st11st1 added the 3.13 bugs and security fixes label Oct 9, 2024
@1st11st1 merged commit 9940093 into python:mainOct 9, 2024
@johnslavik
Copy link
Member

Huge +1.

@1st11st1 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

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

@bedevere-appbedevere-appbot removed the needs backport to 3.13 bugs and security fixes label Oct 10, 2024
@rhansenrhansen 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 freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3.13bugs and security fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@rhansen@johnslavik@1st1