pyo3
pyo3 copied to clipboard
signature of function doesn't support return value
I'd like to write code like this, but it doesn't support writing return value now
#[pymethods]
impl MyClass {
#[pyo3(signature = (x, y, *, abs=true) -> int)]
fn get(x: i32, y: i32, abs: bool) -> u8 {todo!()}
}
Can you explain your use-case why you want a return value here? If this is for type hinting, see #5137
Yes, I'm looking forward to type hinting.
Implemented in #5241 (however we still need to build a lot of the infrastructure)