-
-
Notifications
You must be signed in to change notification settings - Fork 31.2k
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-102810 Add docstrings to the public facing methods of the Timeout class #102811
gh-102810 Add docstrings to the public facing methods of the Timeout class #102811
Conversation
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.
Thanks! Here are a few suggestions for improvement.
Co-authored-by: Guido van Rossum <gvanrossum@gmail.com>
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.
A few small suggestions to make the writing slightly more succinct — though some of these cause the language to diverge slightly from the docs at https://docs.python.org/3/library/asyncio-task.html#asyncio.Timeout, and we might want to keep the docs and the docstrings more-or-less in sync. (Though we generally want the docstrings to be shorter than the docs.)
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.
Oops. Sorry, I changed my mind about some of this. :-(
I agree with Alex's suggestions.
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
…asyncio.timeout and timeout_at
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.
Cool! (@AlexWaygood, if you agree you can merge.)
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.
Two more small things from me.
I'd like to sync the docs here with some of the changes made in this PR: cpython/Doc/library/asyncio-task.rst Lines 623 to 648 in d51a6dc
Some of the new wordings in this PR are much nicer than what we currently have at https://docs.python.org/3/library/asyncio-task.html#asyncio.Timeout, in my opinion; it would be a shame for the docstrings to be improved but to leave the docs as they are. But perhaps this is a large enough task that it can be done in a separate PR. Specific changes to the docs I'd like to see are:
|
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Hiya, @AlexWaygood, w.r.t your last comment: I'm happy to do that in a separate PR or here, whichever you prefer. IMO it might be nicer to get this PR in if you think it's ready, and then we can have a separate PR focussed on the changes to the Sphinx docs that you highlighed. Your call:) |
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.
IMO it might be nicer to get this PR in if you think it's ready, and then we can have a separate PR focussed on the changes to the Sphinx docs that you highlighed.
Sounds good, let's do that! Thanks for working on this :D
Thanks @JosephSBoyle for the PR, and @AlexWaygood for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11. |
GH-102834 is a backport of this pull request to the 3.11 branch. |
…cio.Timeout` (pythonGH-102811) (cherry picked from commit 699cb20) Co-authored-by: JosephSBoyle <48555120+JosephSBoyle@users.noreply.github.com> Co-authored-by: Guido van Rossum <gvanrossum@gmail.com> Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
…cio.Timeout` (python#102811) Co-authored-by: Guido van Rossum <gvanrossum@gmail.com> Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
…cio.Timeout` (python#102811) Co-authored-by: Guido van Rossum <gvanrossum@gmail.com> Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Adds docstrings to the public facing methods of the Timeout class.
Adapted from the docs: https://docs.python.org/3/library/asyncio-task.html#asyncio.Timeout.