[Python-ideas] SyntaxWarning for for/while/else without break or return?

Stephen J. Turnbull stephen at xemacs.org
Thu Oct 8 18:17:38 CEST 2009

Gerald Britton writes:

 > re warnings: The compiler is simply not smart enough to know if a
 > program is doing what a programmer wants.  If a given program is
 > working quietly according to its specifications, we should do nothing
 > to disturb the peace.

That *may* be true for Python, but my face has been saved more times
than I like to think by the warning on

    if (x = f(y))

in many C compilers.  I think I would probably be saved at least once
in my remaining years of Python programming by Nick's proposal, too.

More information about the Python-ideas mailing list