Attaching here two methods of some derived class I have created. For some reason the create static methon fails to compile stating: the trait bound Result<(DerivedClass, BaseClass), PyErr>: OkWrap<_>
is not satisfied .
The big question here is why? the two method do the same thing - and return exactly the same type...
Any idea? Im really stuck on this...
#[pyclass(module = "my_module", name="DerivedClass", extends=BaseClass, subclass)]
#[derive(Serialize, Deserialize)]
pub struct DerivedClass{
pub value: Option
}
#[new]
#[pyo3(signature = (x, y , value=None))]
fn py_new(x: f64, y: f64, value: Option<&int>) -> PyResult<(Self, BaseClass)> {
...
}
#[staticmethod]
#[pyo3(signature = (x, y, value=None))]
fn create(
x: f64, y: f64, value: Option<&int>
) -> PyResult<(Self, BaseClass)> {
... SAME CODE as in py_new
}