rust-cpython icon indicating copy to clipboard operation
rust-cpython copied to clipboard

More examples/features needed

Open Fiedzia opened this issue 8 years ago • 2 comments

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:

  1. defining class properties
  2. default values for parameters - I have no idea how to set them up
  3. Subclassing - I'd like to be able to subclass python enum, and don't even know where to start

Fiedzia avatar Apr 06 '17 09:04 Fiedzia

  1. just added properties in this PR #101

  2. 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> {
    }

fafhrd91 avatar Apr 07 '17 02:04 fafhrd91

Thanks.

Fiedzia avatar Apr 07 '17 08:04 Fiedzia