diff --git a/include/pybind/pybind.h b/include/pybind/pybind.h index 27c888e37..d7ce2c99a 100644 --- a/include/pybind/pybind.h +++ b/include/pybind/pybind.h @@ -208,7 +208,6 @@ public: std::array kw{}, def{}; process_extras(((capture *) m_entry->data)->extras, m_entry, kw.data(), def.data()); - detail::descr d = cast_in::name(kw.data(), def.data()); d += " -> "; d += std::move(cast_out::name()); @@ -276,7 +275,7 @@ private: initialize(d, sizeof...(Arg)); } - static PyObject *dispatcher(PyObject *self, PyObject *args, PyObject *kwargs ) { + static PyObject *dispatcher(PyObject *self, PyObject *args, PyObject *kwargs) { function_entry *overloads = (function_entry *) PyCapsule_GetPointer(self, nullptr); int nargs = (int) PyTuple_Size(args); PyObject *result = nullptr; @@ -285,7 +284,7 @@ private: for (function_entry *it = overloads; it != nullptr; it = it->next) { PyObject *args_ = args; - if (it->keywords != 0 && it->keywords != nargs) { + if (it->keywords != 0 && nargs < it->keywords) { args_ = PyTuple_New(it->keywords); for (int i=0; i