yield-inside-async-function / E1700ΒΆ

Message emitted:

Yield inside async function

Description:

Used when an `yield` or `yield from` statement is found inside an async function.

Problematic code:

async def foo():
    yield from [1, 2, 3]  # [yield-inside-async-function]

Correct code:

async def foo():
    def _inner_foo():
        yield from [1, 2, 3]


async def foo():
    yield 42

Additional details:

The message can't be emitted when using Python < 3.5.

Related links:

Created by the async checker.