throw is an expression, not a statement, in C++. I see no reason raise couldn't be an expression in Python. It doesn't even need a special rule in the grammar:
from __future__ import raise_function foo.setParseAction(lambda a, b, c: raise(MumbleMumble())) Looking up and calling the raise function would add overhead to every explicitly raised exception, but exceptions are so expensive anyway that I think it wouldn't be noticeable. _______________________________________________ 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/2IK43LXP5DFHDL7UGVPXBFP7E6HQPVWG/ Code of Conduct: http://python.org/psf/codeofconduct/