Improve query help

This commit is contained in:
alexey
2019-05-29 16:28:07 +01:00
parent 86ec047be2
commit 9377638834

View File

@@ -17,7 +17,11 @@ Consequently, it is not possible to suggest a general fix.</p>
<example>
<p>In this example, a <code>return</code> statement is used outside a class method in a class and
a <code>yield</code> statement is used outside a function in a scope of a module which would result
in a <code>SyntaxError</code> when running this code.</p>
in a <code>SyntaxError</code> when running this code.
In this example, the invalid class could be corrected by placing the <code>return</code> statement
in a class method, or by refactoring the class into a function. The invalid <code>yield</code> statement
could become part of a new generator function containing the <code>for</code> loop.</p>
<sample src="ReturnOrYieldOutsideFunction.py" />
</example>