pub fn to_pyexception(e: impl Display) -> PyErr
Converts any type that implements Display to a Python Exception.
Display
Exception
Returns a Python error with the error string.