Movatterモバイル変換


[0]ホーム

URL:


homepage

Issue36428

This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title:Support AutoAwait?
Type:Stage:resolved
Components:asyncio, Interpreter CoreVersions:Python 3.8
process
Status:closedResolution:duplicate
Dependencies:Superseder: implement "Async exec"
View:34616
Assigned To:Nosy List: asvetlov, gvanrossum, xtreak, yselivanov
Priority:normalKeywords:

Created on2019-03-25 23:49 bygvanrossum, last changed2022-04-11 14:59 byadmin. This issue is nowclosed.

Messages (4)
msg338840 -(view)Author: Guido van Rossum (gvanrossum)*(Python committer)Date: 2019-03-25 23:49
I just found out about IPython's autoawait feature:https://ipython.readthedocs.io/en/stable/interactive/autoawait.htmlI wonder if we should at least help them do this right in Python 3.8 by having a flag to compile() that allows `await` in the toplevel syntax? It looks like a relatively small change would suffice to make compiler_visit_expr1() inPython/compile.c accept (and generate correct code for) Await_kind outside async functions, if some flag is set.
msg338841 -(view)Author: Yury Selivanov (yselivanov)*(Python committer)Date: 2019-03-25 23:50
Absolutely. I think there's another open issue for this and I even have a dev branch somewhere with this idea half implemented.  Definitely something to have in 3.8.
msg338842 -(view)Author: Karthikeyan Singaravelan (xtreak)*(Python committer)Date: 2019-03-26 00:03
I think this is same asissue34616 . The issue talks about the workarounds IPython has to use for the feature and links to the PR where it was implementedhttps://github.com/ipython/ipython/pull/11265 . I never knew about this feature and this will be very helpful to have especially it reduces boilerplate in having async functions for await calls though asyncio.run improved setting up loop part. Helps in playing around with API in repl during learning with top level await expressions allowed in repl.
msg338843 -(view)Author: Guido van Rossum (gvanrossum)*(Python committer)Date: 2019-03-26 00:05
Oh, you're right. Thanks! Closing in favor ofissue34616.
History
DateUserActionArgs
2022-04-11 14:59:13adminsetgithub: 80609
2019-03-26 00:09:01xtreaksetsuperseder:implement "Async exec"
2019-03-26 00:05:56gvanrossumsetstatus: open -> closed
resolution: duplicate
messages: +msg338843

stage: resolved
2019-03-26 00:03:32xtreaksetnosy: +xtreak
messages: +msg338842
2019-03-25 23:50:59yselivanovsetmessages: +msg338841
2019-03-25 23:49:29gvanrossumcreate
Supported byThe Python Software Foundation,
Powered byRoundup
Copyright © 1990-2022,Python Software Foundation
Legal Statements

[8]ページ先頭

©2009-2026 Movatter.jp