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

Yuvgoog Greenle ubershmekel at gmail.com
Fri Oct 9 02:21:18 CEST 2009


On Fri, Oct 9, 2009 at 1:35 AM, Gerald Britton <gerald.britton at gmail.com> wrote:
> The point is, there are valid reasons to use this construct.  That's
> just one of many, many more.  I would fight tooth-and-nail against a
> warning message, if I thought there was even the faintest chance of it
> being considered.  As it is, there is essentially no chance that it
> will be considered for the compiler (pylint is another matter,  I
> think that it _should_ be there).
>

So you say using "else" to structure the code is a use case, to me
it's just an obfuscation, we can agree to disagree on this. I would
really like to hear your other "many" reasons for using the
"for..else" construct where there are no "break" statements.

--yuv



More information about the Python-ideas mailing list