[Python-ideas] for/else statements considered harmful
ubershmekel at gmail.com
Thu Jun 7 10:31:22 CEST 2012
On Thu, Jun 7, 2012 at 10:57 AM, Devin Jeanpierre <jeanpierreda at gmail.com>wrote:
> On Thu, Jun 7, 2012 at 3:23 AM, Yuval Greenfield <ubershmekel at gmail.com>
> > Personally I'd prefer "if not break:" over "else:" but as we're stuck
> > we are today I'm just going to encourage people not to use the construct
> > all.
> Why shouldn't people use for-else?
> -- Devin
For-else/while-else are confusing. During the previous discussion even the
construct's proponents have fallen to its misleading nature. The word
"else" alone just doesn't fit its role here no matter how intricate and
carefully constructed an example is given to explain its nature or
I believe using for/else will cause you and maintainers of your code to
make more mistakes.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-ideas