Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork34k
gh-142044: Add note to prefer asyncio.timeout/timeout_at over Timeout#144449
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
base:main
Are you sure you want to change the base?
Conversation
Doc/library/asyncio-task.rst Outdated
| An:ref:`asynchronous context manager<async-context-managers>` | ||
| for cancelling overdue coroutines. | ||
| ..note:: |
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.
This note should be placed elsewhere. Either after the class definition or before introducing it.
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
…imeoutDocument that users should prefer using asyncio.timeout() orasyncio.timeout_at() rather than directly instantiating the Timeoutclass, matching the guidance already present in the source code.Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
893bb26 to73df00fComparekovan commentedFeb 4, 2026
I have made the requested changes; please review again |
Thanks for making the requested changes! @picnixz: please review the changes made to this pull request. |
| The context manager produced by:func:`asyncio.timeout` can be | ||
| rescheduled to a different deadline and inspected. | ||
| ..note:: |
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.
After looking at the generated doc, I think a note is a bit too loud. OTOH, I feel that havingTimeout inside the docs oftimeout is also wrong. My suggestion is to put it as a real documented class (outside the function description) and put that note there.
@kumaraditya303 How do you want the docs to be eventually rendered?
Uh oh!
There was an error while loading.Please reload this page.
Summary
Timeoutclass documentation recommending that users preferasyncio.timeout()orasyncio.timeout_at()rather than instantiatingTimeoutdirectlyLib/asyncio/timeouts.py:26-28Test plan
make checkpassed in Doc/ directory🤖 Generated withClaude Code
asyncio.timeout[at]should be preferred overasyncio.Timeout#142044📚 Documentation preview 📚:https://cpython-previews--144449.org.readthedocs.build/