diff --git a/pyo3_bindgen_engine/src/bindgen/function.rs b/pyo3_bindgen_engine/src/bindgen/function.rs index 3c8218c..5350681 100644 --- a/pyo3_bindgen_engine/src/bindgen/function.rs +++ b/pyo3_bindgen_engine/src/bindgen/function.rs @@ -156,10 +156,14 @@ pub fn bind_function( let param_types = parameters .iter() .skip(usize::from(has_self_param)) - .map(|(_, param_annotation, _, _)| { - Type::try_from(param_annotation.unwrap_or_else(|| pynone)) - .unwrap() - .into_rs_borrowed(module_name, all_types) + .map(|&(_, param_annotation, _, param_kind)| { + if param_kind == "VAR_POSITIONAL" { + quote::quote! { impl ::pyo3::IntoPy<::pyo3::Py<::pyo3::types::PyTuple>>} + } else { + Type::try_from(param_annotation.unwrap_or_else(|| pynone)) + .unwrap() + .into_rs_borrowed(module_name, all_types) + } }) .collect_vec();