-
Notifications
You must be signed in to change notification settings - Fork 142
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
Removed check for coroutine in asyncio backend #762
Conversation
69874b0
to
5765883
Compare
@agronholm What do you think about this? |
Frankly I considered the inability to run generator-based coroutine functions a feature rather than a limitation. The main problem with this, however, is that I don't know what ends up a the Furthermore, if we go through with this and flat out disable such checks, we may get inconsistent or misleading error messages across backends when a user tries to pass an incompatible object as the callable to |
Well. We could fix this by replacing anyio's |
Thanks @agronholm, I didn't see #675. |
The question is, where do we draw the line, and how? I don't know just what |
No it doesn't. But then how can Trio accept such coroutine-like objects? It must have some other way of handling their state. |
trio works by checking |
Changes
See #759 (reply in thread).
In the asyncio backend, there is no need to check if the object is a coroutine before launching it as a task:
This already works with the Trio backend, but currently not with the asyncio backend.
Checklist
If this is a user-facing code change, like a bugfix or a new feature, please ensure that
you've fulfilled the following conditions (where applicable):
tests/
) added which would fail without your patchdocs/
, in case of behavior changes or newfeatures)
docs/versionhistory.rst
).If this is a trivial change, like a typo fix or a code reformatting, then you can ignore
these instructions.
Updating the changelog
If there are no entries after the last release, use
**UNRELEASED**
as the version.If, say, your patch fixes issue #123, the entry should look like this:
* Fix big bad boo-boo in task groups (#123 <https://github.com/agronholm/anyio/issues/123>_; PR by @yourgithubaccount)
If there's no issue linked, just link to your pull request instead by updating the
changelog after you've created the PR.