[Python-Dev] Pre-PEP: Unifying try-except and try-finally

Eric Nieuwland eric.nieuwland at xs4all.nl
Fri May 6 22:13:10 CEST 2005


Guido van Rossum wrote:
> try_stmt: 'try' ':' suite
>             (
>                 except_clause ':' suite)+
>                 ['else' ':' suite] ['finally' ':' suite]
>             |
>                 'finally' ':' suite
>             )
>
> There is no real complexity in this grammar, it's unambiguous, it's an
> easy enough job for the code generator, and it catches a certain class
> of mistakes (like mis-indenting some code).

Fair enough. Always nice to have some assistence from the system.

--eric



More information about the Python-Dev mailing list