Skip to content

SyntaxError in await-for-in structure #4907

@xiaxinmeng

Description

@xiaxinmeng

RustPython fails to handle await-for-in structure even the await operation is in an asynchronous function. See the following example:

async def bar():
    [await print(i) for i in [1, 2, 3]]

Expected (on CPython 3.11): work normally

Got on RustPython:

SyntaxError: 'await' outside async function at line 141 column 5
    [await print(i) for i in [1, 2, 3]]
    ^

Environment
Ubuntu 18.04
RustPython 0.2.0
CPython 3.11.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions