pylint-errors

E0105 (yield-outside-function)

:x: Problematic code:

for i in range(10):
    yield i

:heavy_check_mark: Correct code:

def get_values(data):
    yield from data


for i in get_values(range(10)):
    pass

Rationale:

Used when a yield statement is found outside a function or method.