
Inline adoc files when they are included exactly once. Also fix language tags because this inlining gives us better information on what language the code is written in.
40 lines
703 B
Plaintext
40 lines
703 B
Plaintext
== Why is this an issue?
|
|
|
|
``++yield++`` and ``++return++`` only make sense in the context of functions. Using them outside a function raises a ``++SyntaxError++``. To break out of a loop, use ``++break++`` instead.
|
|
|
|
|
|
=== Noncompliant code example
|
|
|
|
[source,python]
|
|
----
|
|
class MyClass:
|
|
while True:
|
|
return False #Noncompliant
|
|
----
|
|
|
|
|
|
|
|
ifdef::env-github,rspecator-view[]
|
|
|
|
'''
|
|
== Implementation Specification
|
|
(visible only on this page)
|
|
|
|
=== Message
|
|
|
|
Remove this use of "xxx".
|
|
|
|
|
|
'''
|
|
== Comments And Links
|
|
(visible only on this page)
|
|
|
|
=== on 17 Mar 2015, 07:59:40 Elena Vilchik wrote:
|
|
Pylint rules
|
|
|
|
E0104: Return outside function
|
|
|
|
E0105: Yield outside function
|
|
|
|
endif::env-github,rspecator-view[]
|