pyo3 icon indicating copy to clipboard operation
pyo3 copied to clipboard

Destructure arguments in function signatures

Open nickdrozd opened this issue 8 months ago • 4 comments

I would like to destructure compound types in function signatures:

type CompoundType = (u64, u64);

#[pyfunction]
pub fn function((arg1, arg2): CompoundType) {}

But this is currently not supported:

error: destructuring in arguments is not supported
  --> src/lib.rs:39:17
   |
39 | pub fn function((arg1, arg2): CompoundType) {}
   |                 ^^^^^^^^^^^^

nickdrozd avatar Jun 03 '24 13:06 nickdrozd