Rather than returning *mut PyObject which may be null, it'd be nice to have an ergonomic API to raise exceptions when need in Rust functions called from Python, and have this encoded in a Result type. The C API documentation for exception handling is located here: https://docs.python.org/3/c-api/exceptions.html
@youknowone wrote up a proof of concept of an error handling model that seems pretty interesting in #1
I like the idea of using a zero sized type (ZST) to mark that an exception has been raised, I think the API may need updating to build on top of what we decide for the basic object abstraction and thread state APIs, but I think it is a great starting point.
Rather than returning
*mut PyObjectwhich may be null, it'd be nice to have an ergonomic API to raise exceptions when need in Rust functions called from Python, and have this encoded in aResulttype. The C API documentation for exception handling is located here: https://docs.python.org/3/c-api/exceptions.html@youknowone wrote up a proof of concept of an error handling model that seems pretty interesting in #1
I like the idea of using a zero sized type (ZST) to mark that an exception has been raised, I think the API may need updating to build on top of what we decide for the basic object abstraction and thread state APIs, but I think it is a great starting point.