Return with argument inside generator


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

This message belongs to the basic checker.


Functions and methods that return values using yield (that is, generators) cannot in addition return values using return.

Python 2.6(?) and above raises a SyntaxError for this situation when importing the module. PyLint reports this error using this message, without depending on the import actually happening.

Add a New Comment
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License