rspec/rules/S2711/python/rule.adoc

13 lines
300 B
Plaintext
Raw Normal View History

2021-04-28 16:49:39 +02:00
``++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.
2021-04-28 16:49:39 +02:00
== Noncompliant Code Example
----
class MyClass:
while True:
return False #Noncompliant
----