rust-cpython
rust-cpython copied to clipboard
More examples/features needed
I am trying to implement bindings for some Rust libraries I am using and few things I am missing that would be nice to have examples for:
- defining class properties
- default values for parameters - I have no idea how to set them up
- Subclassing - I'd like to be able to subclass python enum, and don't even know where to start
-
just added properties in this PR #101
-
default values are defined like this:
def write(&self, data: PyBytes, request_counter: u32 = 0) -> PyResult<PyObject> {
}
def write(&self, data: Option<PyBytes> = None) -> PyResult<PyObject> {
}
Thanks.