Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Formatting fixes in contextlib page#98111

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
JelleZijlstra merged 2 commits intopython:mainfromslateny:s/pr-94361
Oct 12, 2022

Conversation

@slateny
Copy link
Contributor

Removed and added some>>>/... depending on whether it had sample outputs. removed unneeded whitespace, added whitespace to make example 4-space indentation

>>> from asyncio import run
>>> from contextlib import AsyncContextDecorator

>>> class mycontext(AsyncContextDecorator):

Choose a reason for hiding this comment

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

I'm a little sad that this makes the code harder to copy-paste, but agree that this improves consistency. I guess the idea in the existing code was to have no>>> for the code defining the sample classes, only for the code using them. I am going to look at the rest of the docs to see whether that's an established convention.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

If that was the idea, then I think the code block can just be split into two with something like 'managed_resource can then be used like the following:', and have the second chunk contain the>>>

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

i.e.:
image

Choose a reason for hiding this comment

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

I think that would be better, thanks!

@JelleZijlstraJelleZijlstra self-assigned thisOct 12, 2022
@JelleZijlstraJelleZijlstra added needs backport to 3.10only security fixes needs backport to 3.11only security fixes labelsOct 12, 2022
@JelleZijlstraJelleZijlstra merged commit3b33c20 intopython:mainOct 12, 2022
@miss-islington
Copy link
Contributor

Thanks@slateny for the PR, and@JelleZijlstra for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10, 3.11.
🐍🍒⛏🤖

@bedevere-bot
Copy link

GH-98205 is a backport of this pull request to the3.11 branch.

@bedevere-botbedevere-bot removed the needs backport to 3.11only security fixes labelOct 12, 2022
@bedevere-bot
Copy link

GH-98206 is a backport of this pull request to the3.10 branch.

@bedevere-botbedevere-bot removed the needs backport to 3.10only security fixes labelOct 12, 2022
miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestOct 12, 2022
(cherry picked from commit3b33c20)Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestOct 12, 2022
(cherry picked from commit3b33c20)Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com>
miss-islington added a commit that referenced this pull requestOct 12, 2022
(cherry picked from commit3b33c20)Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com>
miss-islington added a commit that referenced this pull requestOct 12, 2022
(cherry picked from commit3b33c20)Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com>
carljm added a commit to carljm/cpython that referenced this pull requestOct 14, 2022
* main: (38 commits)pythongh-98251: Allow venv to pass along PYTHON* variables to pip and ensurepip when they do not impact path resolution (pythonGH-98259)  Bpo-41246: IOCP Proactor avoid callback code duplication (python#21399)  bpo-46364: Use sockets for stdin of asyncio only on AIX (python#30596)pythongh-98178: syslog() is not thread-safe on macOS (python#98213)  Mark all targets in `Doc/Makefile` as `PHONY` (pythonGH-98189)pythongh-97982: Factorize PyUnicode_Count() and unicode_count() code (python#98025)pythongh-96265: Formatting changes for faq/general (python#98129)  tutorial: remove "with single quotes" (python#98204)pythongh-97669: Remove Tools/scripts/startuptime.py (python#98214)  signalmodule.c uses _PyErr_WriteUnraisableMsg() (python#98217)pythongh-97669: Fix test_tools reference leak (python#98216)pythongh-97669: Create Tools/patchcheck/ directory (python#98186)pythongh-65046: Link to logging cookbook from asyncio docs (python#98207)  Formatting fixes in contextlib docs (python#98111)pythongh-95276: Add callable entry to the glossary (python#95738)pythongh-96130: Rephrase use of "typecheck" verb for clarity (python#98144)  Fix some incorrect indentation around the main switch (python#98177)pythongh-98172: Fix formatting in `except*` docs (python#98173)pythongh-97982: Remove asciilib_count() (python#98164)pythongh-95756: Free and NULL-out code caches when needed (pythonGH-98181)  ...
carljm added a commit to carljm/cpython that referenced this pull requestOct 14, 2022
* main: (37 commits)pythongh-98251: Allow venv to pass along PYTHON* variables to pip and ensurepip when they do not impact path resolution (pythonGH-98259)  Bpo-41246: IOCP Proactor avoid callback code duplication (python#21399)  bpo-46364: Use sockets for stdin of asyncio only on AIX (python#30596)pythongh-98178: syslog() is not thread-safe on macOS (python#98213)  Mark all targets in `Doc/Makefile` as `PHONY` (pythonGH-98189)pythongh-97982: Factorize PyUnicode_Count() and unicode_count() code (python#98025)pythongh-96265: Formatting changes for faq/general (python#98129)  tutorial: remove "with single quotes" (python#98204)pythongh-97669: Remove Tools/scripts/startuptime.py (python#98214)  signalmodule.c uses _PyErr_WriteUnraisableMsg() (python#98217)pythongh-97669: Fix test_tools reference leak (python#98216)pythongh-97669: Create Tools/patchcheck/ directory (python#98186)pythongh-65046: Link to logging cookbook from asyncio docs (python#98207)  Formatting fixes in contextlib docs (python#98111)pythongh-95276: Add callable entry to the glossary (python#95738)pythongh-96130: Rephrase use of "typecheck" verb for clarity (python#98144)  Fix some incorrect indentation around the main switch (python#98177)pythongh-98172: Fix formatting in `except*` docs (python#98173)pythongh-97982: Remove asciilib_count() (python#98164)pythongh-95756: Free and NULL-out code caches when needed (pythonGH-98181)  ...
pablogsal pushed a commit that referenced this pull requestOct 22, 2022
(cherry picked from commit3b33c20)Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com>
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@JelleZijlstraJelleZijlstraJelleZijlstra approved these changes

@1st11st1Awaiting requested review from 1st1

Assignees

@JelleZijlstraJelleZijlstra

Labels

docsDocumentation in the Doc dirskip issueskip news

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@slateny@miss-islington@bedevere-bot@JelleZijlstra

[8]ページ先頭

©2009-2025 Movatter.jp