.. _init-is-generator:

init-is-generator / E0100
=========================

**Message emitted:**

__init__ method is a generator

**Description:**

*Used when the special class method __init__ is turned into a generator by a yield in its body.*

**Problematic code:**

.. literalinclude:: /data/messages/i/init-is-generator/bad.py
   :language: python

**Correct code:**

.. literalinclude:: /data/messages/i/init-is-generator/good.py
   :language: python



Created by the `basic <https://github.com/PyCQA/pylint/blob/main/pylint/checkers/base/basic_error_checker.py>`__ checker.