[code-quality] Fwd: Spurious useless-else-on-loop warning

Skip Montanaro skip at pobox.com
Wed Sep 18 03:38:39 CEST 2013


> But this "else" is useless, isn't it?  Just put the "return dt" statement after the for statement, no else needed.

In this particular case, yes, but that's not the point of the post.
Pylint doesn't check to see what's in the else clause, only whether
there is an early exit from the body of the loop.

Skip


More information about the code-quality mailing list