From 5257330e6add34a2139d0999520fe3f45df949e4 Mon Sep 17 00:00:00 2001 From: Wenzel Jakob Date: Mon, 14 Sep 2015 16:38:47 +0200 Subject: [PATCH] keyword processing bugfix --- include/pybind/pybind.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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