GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||
GeezerVison is showing github.com — Add Python 3.12 beta to test matrix by harshil21 · Pull Request #3751 · python-telegram-bot/python-telegram-bot 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 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
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. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@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 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
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 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem 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.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem 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 :)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
pre-commit.ci run |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.