This rule is deprecated; use S5905 instead.
Why is this an issue?
Parentheses are not required after the assert
, del
, elif
, except
, for
,
if
, in
, not
, raise
, return
, while
, and yield
keywords, and
using them unnecessarily impairs readability. They should therefore 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