Skip to content

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

Merged
merged 4 commits into from
May 30, 2019

Conversation

agronholm
Copy link
Contributor

@agronholm agronholm commented May 30, 2019

@@ -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.
Copy link
Contributor

Choose a reason for hiding this comment

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

I dislike mentioning constructor here.

Above we have the text:

   Use the high-level :func:`asyncio.create_task` function to create
   Tasks, or the low-level :meth:`loop.create_task` or
   :func:`ensure_future` functions.  Manual instantiation of Tasks
   is discouraged.

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.

Copy link
Member

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".

@@ -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.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Return the coroutine object that was passed to the constructor.
Return the coroutine object wrapped by the :class:`Task`.

@1st1 like this?

Copy link
Member

Choose a reason for hiding this comment

The 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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I changed the wording now as requested.

Copy link
Contributor

Choose a reason for hiding this comment

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

Great!

@miss-islington miss-islington merged commit 98ef920 into python:master May 30, 2019
@asvetlov
Copy link
Contributor

Thanks!

@agronholm agronholm deleted the fix-issue-36999 branch May 30, 2019 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants