This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: async for statement is not a syntax error in sync context
Type: behavior Stage: resolved
Components: Interpreter Core Versions: Python 3.8, Python 3.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: lukasz.langa, ned.deily, njs, yselivanov, zsol
Priority: release blocker Keywords: patch

Created on 2018-04-26 05:18 by zsol, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 6616 merged zsol, 2018-04-27 05:17
PR 6619 merged zsol, 2018-04-27 17:07
Messages (6)
msg315775 - (view) Author: Zsolt Dollenstein (zsol) * Date: 2018-04-26 05:18
Since 3.7, async generators can be used in non-async functions. The way this is implemented allows the following to be valid syntax:

def f():
    async for i in aiterable:
        pass
    return 1

The return value of the above function is a Future that will never be done().
msg315776 - (view) Author: Yury Selivanov (yselivanov) * (Python committer) Date: 2018-04-26 05:24
Wow, this is a regression that has to be fixed in 3.7.
msg315777 - (view) Author: Nathaniel Smith (njs) * (Python committer) Date: 2018-04-26 05:28
Sorry, not sure why bpo decided to reset the priority there.
msg315847 - (view) Author: Yury Selivanov (yselivanov) * (Python committer) Date: 2018-04-27 15:58
New changeset e2396506606115e785c94ec129eb86e2ed0aa744 by Yury Selivanov (Zsolt Dollenstein) in branch 'master':
bpo-33363: raise SyntaxError for async for/with outside async functions (#6616)
https://github.com/python/cpython/commit/e2396506606115e785c94ec129eb86e2ed0aa744
msg315859 - (view) Author: Yury Selivanov (yselivanov) * (Python committer) Date: 2018-04-27 22:33
New changeset a93a663d6c2fdfbddbda9729c96e2737c0012522 by Yury Selivanov (Zsolt Dollenstein) in branch '3.7':
[3.7] bpo-33363: raise SyntaxError for async for/with outside async functions (GH-6616). (GH-6619)
https://github.com/python/cpython/commit/a93a663d6c2fdfbddbda9729c96e2737c0012522
msg315860 - (view) Author: Yury Selivanov (yselivanov) * (Python committer) Date: 2018-04-27 22:34
Thanks so much!
History
Date User Action Args
2022-04-11 14:58:59adminsetnosy: + lukasz.langa
github: 77544
2018-04-27 22:34:03yselivanovsetstatus: open -> closed
resolution: fixed
messages: + msg315860

stage: patch review -> resolved
2018-04-27 22:33:44yselivanovsetmessages: + msg315859
2018-04-27 17:07:56zsolsetpull_requests: + pull_request6315
2018-04-27 15:58:59yselivanovsetmessages: + msg315847
2018-04-27 05:17:28zsolsetkeywords: + patch
stage: patch review
pull_requests: + pull_request6312
2018-04-26 05:28:34njssetpriority: normal -> release blocker

messages: + msg315777
2018-04-26 05:28:06njssetpriority: release blocker -> normal
nosy: + njs
2018-04-26 05:24:07yselivanovsetpriority: normal -> release blocker
nosy: + yselivanov, ned.deily
messages: + msg315776

2018-04-26 05:18:50zsolcreate