A quirk/gotcha of for i, x in enumerate(seq) when seq is empty
arnodel at gmail.com
Fri Feb 24 16:00:16 CET 2012
On 24 February 2012 14:54, Steven D'Aprano
<steve+comp.lang.python at pearwood.info> wrote:
> for...else is a very useful construct, but the name is misleading. It
> took me a long time to stop thinking that the else clause executes when
> the for loop was empty.
This is why I think we should call this construct "for / break / else"
rather than "for / else".
More information about the Python-list