return from finally clause

D-Man dsh8290 at rit.edu
Sat Jun 9 10:48:28 EDT 2001


On Fri, Jun 08, 2001 at 09:16:43PM -0400, Steve Holden wrote:
| "Joshua Marshall" <jmarshal at mathworks.com> wrote in message
| news:9frdgk$pnd$1 at news.mathworks.com...
| > "J?rgen Hermann" <jh at web.de> wrote:
| >
| > > That means that if you (accidently?) return within a finally clause, you
| > > effectively eat the exception. This should be documented, or fixed.
| >
| > That's unpleasant.  I hope it's a bug.
| >
| Well, I think we  can agree that there's a certain inconsistency in
| returning from a function with an exception active like that. So most of all
| it's a programming error. What action would be best? Raise another exception
| when the "return" is executed?

There is no exception acvite -- you have handled it and now want to
return a value instead of propagating the exception.

-D





More information about the Python-list mailing list