[Python-ideas] for/else syntax
greg.ewing at canterbury.ac.nz
Sat Oct 3 04:07:04 CEST 2009
Steven D'Aprano wrote:
> if cond:
> raise ValueError
> print "no exception was raised"
> print "done"
According to the Language Reference, the finally clause protects all of
the preceding clauses in the try statement, including the else clause.
So this would be equivalent to
print "no exception was raised"
More information about the Python-ideas