-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Add Python 3.12 beta to test matrix #3751
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
Conversation
def gen():
yield
await asyncio.create_task(gen()) does not work in python 3.12. Changing into an The 3.12 changelog notes: "asyncio.iscoroutine() now returns False for generators as asyncio does not support legacy generator-based coroutines." Does this mean we should drop support for generators in Related code and PRs: https://github.com/python/cpython/blob/main/Lib/asyncio/tasks.py#L106-L110 |
Also remove support for generators in app.create_task
Not for py 3.11-, as that would be a breach of our stability policy. We can think about deprecating it, but dropping support unannounced is a no-go. |
@Bibo-Joshi okay, now how do I specify different type hints for the and what kind of workaround do you suggest for py3.12+? I don't see any |
Sounds good if that works reasonably well. Don't know if it's possible to make only the overload part the content of the if clause or if you have to define the method twice
I don't have anything in mind TBH, haven't looked into it yet |
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 double checked by running mypy in different python versions, and also checked if VSCode shows a type error when passing an (async) generator to app.create_task
for py > 3.12.
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.
Hey! Looks like you edited the (optional) requirements or the pre-commit hooks. I'm just a friendly reminder to keep the additional dependencies for the hooks in sync with the requirements :)
pre-commit.ci run |
To be merged after #3728
Things changed for us:
__abstractmethods__
to dynamically get all defined abstract methods.app.create_task
should not accept generators. See below post