Skip to content

Yield-Outside-Generator

Sourcery rule id: yield-outside-generator

Description

Cannot use yield outside a generator function

Match

yield

Explanation

The yield keyword is used to pause and resume a generator function. If yield is used outside a generator function or method it will throw a SyntaxError