[Haskell-cafe] Control.Exception.bracket is broken(?)
Yuras Shumovich
shumovichy at gmail.com
Sun Jul 6 14:16:28 UTC 2014
On Sun, 2014-07-06 at 08:37 -0500, Mike Meyer wrote:
> You left off what I think is the best behavior, from Python 3:
>
> 4) Throw the exception for the release action, chaining the original
> exception to it. The default exception handler reports the them both.
You mean the "__context__" attribute of the exception? Java also allows
one to get the suppressed exception via "Throwable.getSuppressed"
method. But python3 suppresses the original exception, while java does
the opposite, so I'm ok to count it as a separate option (#4). Thanks.
>
> > I prefer #2 because suppressing exception is a really bad idea. What is
> > your choice?
>
> #4.
Is it common for python3 code to be prepared to handle __context__? I
guess most developers just ignore it. So probably #1 is better?
More information about the Haskell-Cafe
mailing list