diff --git a/include/pybind11/pybind11.h b/include/pybind11/pybind11.h index 302a8a09c..38bc5fc45 100644 --- a/include/pybind11/pybind11.h +++ b/include/pybind11/pybind11.h @@ -214,7 +214,7 @@ protected: rec->is_constructor = !strcmp(rec->name, "__init__") || !strcmp(rec->name, "__setstate__"); rec->has_args = false; rec->has_kwargs = false; - rec->nargs = args; + rec->nargs = (uint16_t) args; #if PY_MAJOR_VERSION < 3 if (rec->sibling && PyMethod_Check(rec->sibling.ptr()))