[Python-Dev] Chaining try statements: eltry?

David Abrahams dave at boost-consulting.com
Thu Jul 7 20:57:55 CEST 2005


Tim Peters <tim.peters at gmail.com> writes:

> I also suspect that if they weren't in the language already, a PEP to
> introduce them would fail, because
>
>     still_looking = True
>     some loop:
>         if found it:
>             still_looking = False
>             break
>     if still_looking:
>         # what would have been in the "else" clause
>
> is clear and easy to write without it.

Oh, that's wierd.  I didn't know there were "else" clauses for loops,
but I would've expected the other semantics.  That is, either the loop
terminates normally, "else:" whatever.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com



More information about the Python-Dev mailing list