.. _return-arg-in-generator:

return-arg-in-generator / E0106
===============================

**Message emitted:**

Return with argument inside generator

**Description:**

*Used when a "return" statement with an argument is found outside in a generator function or method (e.g. with some "yield" statements).*


**Correct code:**

.. literalinclude:: /data/messages/r/return-arg-in-generator/good.py
   :language: python

**Additional details:**

You can help us make the doc better `by contributing <https://github.com/PyCQA/pylint/issues/5953>`_ !


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