org.sonar.l10n.py.rules.python.S1721.html Maven / Gradle / Ivy
This rule is deprecated; use {rule:python:S5905} instead.
Why is this an issue?
Parentheses are not required after the assert
, del
, elif
, except
, for
,
if
, not
, raise
, return
, while
, and yield
keywords. Similarly,
parentheses are not required after in
in a for
loop. Using parentheses unnecessarily impairs readability, and therefore,
they should be omitted.
Noncompliant code example
x = 1
while (x < 10):
print "x is now %d" % (x)
x += 1
Compliant solution
x = 1
while x < 10:
print "x is now %d" % (x)
x += 1
© 2015 - 2024 Weber Informatics LLC | Privacy Policy