@@ -299,7 +299,7 @@ PyObject *nb_func_new(const func_data_prelim_base *f) noexcept {
299299
300300 // Check if the complex dispatch loop is needed
301301 bool complex_call = can_mutate_args || has_var_kwargs || has_var_args ||
302- f->nargs >= NB_MAXARGS_SIMPLE;
302+ f->nargs > NB_MAXARGS_SIMPLE;
303303
304304 if (has_args) {
305305 for (size_t i = is_method; i < f->nargs ; ++i) {
@@ -690,16 +690,16 @@ static PyObject *nb_func_vectorcall_complex(PyObject *self,
690690 entries using keyword arguments or default argument values provided
691691 in the bindings, if available.
692692
693- 3 . Ensure that either all keyword arguments were "consumed", or that
693+ 2 . Ensure that either all keyword arguments were "consumed", or that
694694 the function takes a kwargs argument to accept unconsumed kwargs.
695695
696- 4 . Any positional arguments still left get put into a tuple (for args),
696+ 3 . Any positional arguments still left get put into a tuple (for args),
697697 and any leftover kwargs get put into a dict.
698698
699- 5 . Pack everything into a vector; if we have nb::args or nb::kwargs, they are an
700- extra tuple or dict at the end of the positional arguments.
699+ 4 . Pack everything into a vector; if we have nb::args or nb::kwargs,
700+ they become a tuple or dict at the end of the positional arguments.
701701
702- 6 . Call the function call dispatcher (func_data::impl)
702+ 5 . Call the function call dispatcher (func_data::impl)
703703
704704 If one of these fail, move on to the next overload and keep trying
705705 until we get a result other than NB_NEXT_OVERLOAD.
@@ -878,7 +878,8 @@ static PyObject *nb_func_vectorcall_complex(PyObject *self,
878878 return result;
879879}
880880
881- // / Simplified nb_func_vectorcall variant for functions w/o keyword arguments
881+ // / Simplified nb_func_vectorcall variant for functions w/o keyword arguments,
882+ // / w/o default arguments, with no more than NB_MAXARGS_SIMPLE arguments, etc.
882883static PyObject *nb_func_vectorcall_simple (PyObject *self,
883884 PyObject *const *args_in,
884885 size_t nargsf,
0 commit comments