On Tue, Feb 25, 2014 at 11:27 AM, Jim J. Jewett <jimjjew...@gmail.com> wrote:
> This also makes me wonder whether the cost of a subscope
> (for exception capture) could be limited to when an
> exception actually occurs, and whether that might lower
> the cost enough to make the it a good tradeoff.
>
>     def myfunc1(a, b, e):
>         assert "main scope e value" == e
>
>     e = "main scope e value"
>     value = (myfunc1(val1, val2, e)
>               except e.reason if AppError as e)
>     assert "main scope e value" == e

I'm sure it could. But there aren't many use-cases. Look at the one
example I was able to find in the stdlib:

http://legacy.python.org/dev/peps/pep-0463/#capturing-the-exception-object

It's hardly a shining example of the value of the proposal. Got any
really awesome demo that requires 'as'? Most of the supporting
examples use something like KeyError where it's simply "was an
exception thrown or not".

ChrisA
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to