On Sun, Oct 27, 2019 at 4:17 PM Andrew Barnert <abarn...@yahoo.com> wrote:
> On Oct 27, 2019, at 15:07, Ben Rudiak-Gould <benrud...@gmail.com> wrote:
> >    from __future__ import raise_function
> That’s a pretty big breaking change.

I agree, it's a bad idea. It'd have to be Python 4, like
print_function was Python 3.

>     def throw(e): raise e

The problem with this is that it adds an extra line to the traceback,
so you have to choose between the convenience of using it and the
convenience of more readable tracebacks.

Writing it in C would fix that, but it's pretty complicated (I think I
could copy the logic from do_raise in ceval.c, but I'm not completely
sure, and it's almost 100 lines long), and of course not portable. I
wouldn't mind having a sys.throw or something that's guaranteed to do
it correctly.

Actually, it'd be nice to have some general way to write trivial
wrappers in Python without uglifying tracebacks, but that's a
different discussion.
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/7CU6GLIMZIHGESNTBU5OMCYMOJO42B7C/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to