Skip to content

Commit

Permalink
Improve semantics of positional *args parameters
Browse files Browse the repository at this point in the history
Signed-off-by: Andrej Orsula <[email protected]>
  • Loading branch information
AndrejOrsula committed Jan 26, 2024
1 parent 0b22727 commit 37d7d68
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions pyo3_bindgen_engine/src/bindgen/function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,14 @@ pub fn bind_function<S: ::std::hash::BuildHasher + Default>(
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();

Expand Down

0 comments on commit 37d7d68

Please sign in to comment.