On Sun, Oct 27, 2019 at 4:17 PM Andrew Barnert
On Oct 27, 2019, at 15:07, Ben Rudiak-Gould
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.