Open llchan opened 7 years ago
@romanvm @dean0x7d thanks for adding the helper func. Can we also mention this in the docs?
@llchan It's mentioned in the API reference for error_already_set.
I see, looks good, but I was thinking we could also add something in the tutorial-ish section here: http://pybind11.readthedocs.io/en/master/advanced/exceptions.html
Ah, right, it does seem like that section is overwhelmingly about C++ -> Python exception translation, but not the other way around. If you have something in mind for it, would you be willing to submit a PR?
If I want to perform the C++ equivalent of this python code:
I can do it like this, but it's rather verbose:
Is there a more idiomatic way to do this? If not, could we modify the type hierarchy and/or the
error_already_set
mechanism to allow for something closer to this?