Repository navigation
bpo-36999: Add asyncio.Task.get_coro() #13680
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
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -842,6 +842,12 @@ Task Object | |||||
| The *file* argument is an I/O stream to which the output | ||||||
| is written; by default output is written to :data:`sys.stderr`. | ||||||
|
|
||||||
| .. method:: get_coro() | ||||||
|
|
||||||
| Return the coroutine object that was passed to the constructor. | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
@1st1 like this?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, I think it's great. If you have time just merge Alex's PR and we can fix this ourselves. Up to you.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I changed the wording now as requested.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Great! |
||||||
|
|
||||||
| .. versionadded:: 3.8 | ||||||
|
|
||||||
| .. method:: get_name() | ||||||
|
|
||||||
| Return the name of the Task. | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| Add the ``asyncio.Task.get_coro()`` method to publicly expose the tasks's | ||
| coroutine object. |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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.
I dislike mentioning
constructorhere.Above we have the text:
Maybe rephrase this line to
Return the coroutine object that was used for the task creation.or something like this?Sorry, I'm not a native speaker. Don't insist on the exact wording but you've got my idea.
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.
I'd just say this: "Return the coroutine object wrapped by the Task".