On 2014-06-08, Dave Angel <da...@davea.name> wrote:
> Frank B <fbick...@gmail.com> Wrote in message:
>> Ok; this is a bit esoteric.
>> So finally is executed regardless of whether an exception occurs, so states
>> the docs.
>> But, I thought, if I <return> from my function first, that should take
>> au contraire
>> Turns out that if you do this:
>> except FailException:
>> return 0
>> return 1
>> Then finally really is executed regardless... even though you told it to
>> That seems odd to me.
> The thing that's odd to me is that a return is permissible inside
> a finally block. That return
> should be at top level, even with the finally line. And of course
> something else should be in the body of the finally
It does have some legitimate uses, for example:
OTOH, it could just be that Guido didn't think of banning it when
exceptions were first added and doesn't want to introduce an