Skip to content

Commit 5c879b0

Browse files
committed
Add macro call to allow function up to seven parameters
1 parent a64ecbf commit 5c879b0

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

vm/src/function.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -506,15 +506,17 @@ macro_rules! tuple_from_py_func_args {
506506
};
507507
}
508508

509-
// Implement `FromArgs` for up to 5-tuples, allowing built-in functions to bind
510-
// up to 5 top-level parameters (note that `Args`, `KwArgs`, nested tuples, etc.
509+
// Implement `FromArgs` for up to 7-tuples, allowing built-in functions to bind
510+
// up to 7 top-level parameters (note that `Args`, `KwArgs`, nested tuples, etc.
511511
// count as 1, so this should actually be more than enough).
512512
tuple_from_py_func_args!(A);
513513
tuple_from_py_func_args!(A, B);
514514
tuple_from_py_func_args!(A, B, C);
515515
tuple_from_py_func_args!(A, B, C, D);
516516
tuple_from_py_func_args!(A, B, C, D, E);
517517
tuple_from_py_func_args!(A, B, C, D, E, F);
518+
tuple_from_py_func_args!(A, B, C, D, E, F, G);
519+
tuple_from_py_func_args!(A, B, C, D, E, F, G, H);
518520

519521
/// A built-in Python function.
520522
pub type PyNativeFunc = Box<py_dyn_fn!(dyn Fn(&VirtualMachine, FuncArgs) -> PyResult)>;
@@ -640,6 +642,8 @@ into_py_native_func_tuple!((v1, T1), (v2, T2));
640642
into_py_native_func_tuple!((v1, T1), (v2, T2), (v3, T3));
641643
into_py_native_func_tuple!((v1, T1), (v2, T2), (v3, T3), (v4, T4));
642644
into_py_native_func_tuple!((v1, T1), (v2, T2), (v3, T3), (v4, T4), (v5, T5));
645+
into_py_native_func_tuple!((v1, T1), (v2, T2), (v3, T3), (v4, T4), (v5, T5), (v6, T6));
646+
// into_py_native_func_tuple!((v1, T1), (v2, T2), (v3, T3), (v4, T4), (v5, T5), (v6, T6), (v7, T7));
643647

644648
/// Tests that the predicate is True on a single value, or if the value is a tuple a tuple, then
645649
/// test that any of the values contained within the tuples satisfies the predicate. Type parameter

0 commit comments

Comments
 (0)