yield-inside-async-function / E1700#

Message emitted:

Yield inside async function


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

Correct code:

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

async def foo():
    yield 42

Problematic code:

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

Additional details:

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

Related links:

Created by the async checker.