-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Since capitalization style between initialisms differs between python (prefer QCSError), and rust (prefer QcsError) it would be nice to have a similar pattern to py_wrap_type to make an alias:
use rigetti_pyo3::{py_wrap_error, wrap_error, create_init_submodule};
use pyo3::exceptions::{PyRuntimeError};
wrap_error!(
ClientError(some_other_mod::ClientError) as "QCSClientError" // <-- feels most similar to other patterns
);
py_wrap_error!(
this_mod,
ClientError,
QcsClientError, // <-- in its current state, the internal `pyo3::crate_exception!` annotates this with
// `#[allow(non_camel_case_types)]` so it is acceptable to use `QCSClientError` here
// without any changes.
PyRuntimeError,
// <-- the internal `pyo3::create_exception!` macro takes an optional `doc` parameter
// that we aren't using, some potential re-use there.
);
create_init_submodule! {
errors: [QcsClientError], // <-- calls `std::stringify!(QcsClientError)` so would need to be changed
}Metadata
Metadata
Assignees
Labels
No labels