KEMBAR78
async for/async with are allowed in non-async functions · Issue #10594 · python/mypy · GitHub
Skip to content

async for/async with are allowed in non-async functions #10594

@Dreamsorcerer

Description

@Dreamsorcerer

To Reproduce

async def b():
 for i in range(5):
  yield i

def a():
 return [x async for x in b()]

Expected Behavior

Syntax error. When trying to run with python this code gives a syntax error.

Actual Behavior

Passed with no errors.

Your Environment

  • Mypy version used: 0.812
  • Python version used: 3.8

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions