Skip to content
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

Clarify that AsyncExitStack works with coroutine functions #9405

Merged

Conversation

njsmith
Copy link
Contributor

@njsmith njsmith commented Sep 18, 2018

The docs were ambiguous about whether you pass in a coroutine function
or a coroutine object, e.g. is it:

aestack.push_async_exit(some_async_func)

or

aestack.push_async_exit(some_async_func())

(It's the first one.)

Here's an example of a user citing the docs as proof that it works the
way it doesn't work: python-trio/trio#671 (comment)

The docs were ambiguous about whether you pass in a coroutine function
or a coroutine object, e.g. is it:

  aestack.push_async_exit(some_async_func)

or

  aestack.push_async_exit(some_async_func())

(It's the first one.)
Copy link
Contributor

@willingc willingc left a comment

Choose a reason for hiding this comment

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

Thanks @njsmith.

@willingc willingc merged commit a3c88ef into python:master Sep 18, 2018
@miss-islington
Copy link
Contributor

Thanks @njsmith for the PR, and @willingc for merging it 🌮🎉.. I'm working now to backport this PR to: 3.7.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Sep 18, 2018
…9405)

The docs were ambiguous about whether you pass in a coroutine function
or a coroutine object, e.g. is it:

  aestack.push_async_exit(some_async_func)

or

  aestack.push_async_exit(some_async_func())

(It's the first one.)
(cherry picked from commit a3c88ef)

Co-authored-by: Nathaniel J. Smith <[email protected]>
@bedevere-bot
Copy link

GH-9408 is a backport of this pull request to the 3.7 branch.

@njsmith njsmith deleted the asyncexitstack-coroutine-clarification branch September 18, 2018 21:35
ned-deily pushed a commit that referenced this pull request Oct 6, 2018
…H-9408)

The docs were ambiguous about whether you pass in a coroutine function
or a coroutine object, e.g. is it:

  aestack.push_async_exit(some_async_func)

or

  aestack.push_async_exit(some_async_func())

(It's the first one.)
(cherry picked from commit a3c88ef)

Co-authored-by: Nathaniel J. Smith <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir skip issue skip news
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants