try: finally: question
OKB (not okblacke)
BrenBarn at aol.com
Thu Jul 15 21:51:21 EDT 2004
Tim Peters wrote:
> Not because it can't be defined clearly, but
> because any way of defining it is so arbitrary it leaves half of
> programmers believing that the other way of defining it was "the only
> obvious" way. Don't allow mixing except with finally, and the
> programmer has to be explicit about their intent. That was (and
> remains) a Pythonic solution.
Out of curiosity, what would be wrong with allowing both, but
insisting that the finally block (if it exists ) must come last? The
code layout would then clearly suggest the semantics: the finally comes
last. This is the thing I most often want to write anyway.
--
--OKB (not okblacke)
Brendan Barnwell
"Do not follow where the path may lead. Go, instead, where there is
no path, and leave a trail."
--author unknown
More information about the Python-list
mailing list