for -- else: what was the motivation?

Grant Edwards grant.b.edwards at gmail.com
Sat Oct 15 11:16:04 EDT 2022


On 2022-10-12, Rob Cliffe via Python-list <python-list at python.org> wrote:
> I too have occasionally used for ... else.  It does have its uses. But 
> oh, how I wish it had been called something else more meaningful, 
> whether 'nobreak' or whatever.

I use it a few times year. I have to look it up in the documentation
every single time I do, and I always add a comment in the "else"
clause stating whether the looped completed "normally" or not.

--
Grant


More information about the Python-list mailing list