mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-02 14:52:01 +00:00
344 B
344 B
yield-in-init (PLE0100)
Derived from the Pylint linter.
What it does
Checks for __init__
methods that turned into generators
via the presence of yield
or yield from
statements.
Why is this bad?
Generators are not allowed in __init__
methods.
Example
class Foo:
def __init__(self):
yield 1