Add Python 3.12 beta to test matrix#3751
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 |
harshil21
left a comment
There was a problem hiding this comment.
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.
|
pre-commit.ci run |
To be merged after #3728
Things changed for us:
__abstractmethods__to dynamically get all defined abstract methods.app.create_taskshould not accept generators. See below post