Closed
Description
Some python package apis require the user the raise specific errors in certain scenarios. For example, Optuna requires the user to conditionally TrialPruned()
error. In the current implementation of PythonCall, raising such errors from julia functions does not seem to be possible.
@pyeval `raise optuna.TrialPruned()`
fails with Python: SyntaxError: invalid syntax
.
It would be handy to have a function like pyraise
to throw such errors manually.