stop-iteration-return / R1708#

Message emitted:

Do not raise StopIteration in generator, use return statement instead


According to PEP479, the raise of StopIteration to end the loop of a generator may lead to hard to find bugs. This PEP specify that raise StopIteration has to be replaced by a simple return statement

Correct code:

# This is a placeholder for correct code for this message.

Additional details:

You can help us make the doc better by contributing !

Created by the refactoring checker.