-
-
Notifications
You must be signed in to change notification settings - Fork 32k
recommend what to use instead of asyncio.get_event_loop in 3.14 what's new #127174
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
Comments
Currently: import asyncio
async def amain():
await asyncio.sleep(0)
print("slept")
asyncio.get_event_loop().run_until_complete(amain()) Will fail on 3.14 Code should use import asyncio
async def amain():
await asyncio.sleep(0)
print("slept")
asyncio.run(amain()) Instead It may be that a user will need to interleave synchronous code with calls into and back out of the event loop in which case It is not correct to simply replace |
Sorry, I've missed. What part of docs should be corrected? |
It's the what's new section |
@graingert Would you like to send a PR for it? I'll review it. |
I'll give it a go, feel free for someone else to do it if it's not done by next week |
Co-authored-by: Kumar Aditya <[email protected]>
…thon#127640) Co-authored-by: Kumar Aditya <[email protected]>
Originally posted by @hroncok in #126354 (comment)
Linked PRs
The text was updated successfully, but these errors were encountered: