m.def(
"project",
[](const py::object &df, const py::args &args, const string &groups) {
return true;
},
py::arg("df"), py::arg("args"), py::kw_only(), py::arg("kw1") = "");
lib/python3.12/site-packages/pybind11/include/pybind11/pybind11.h:261:9: error: static assertion failed due to requirement 'expected_num_args<pybind11::name, pybind11::scope, pybind11::sibling, pybind11::arg, pybind11::arg, pybind11::kw_only, pybind11::arg_v>(sizeof...(Args), argument_loader<const py::object &, const pybind11::args &, const std::string &>::args_pos >= 0, argument_loader<const py::object &, const pybind11::args &, const std::string &>::has_kwargs)': The number of argument annotations does not match the number of function arguments
static_assert(
^
lib/python3.12/site-packages/pybind11/include/pybind11/pybind11.h:145:9: note: in instantiation of function template specialization 'pybind11::cpp_function::initialize<(lambda at source.cpp:818:6), std::unique_ptr<duckdb::DuckDBPyRelation>, const py::object &, const pybind11::args &, const std::string &, pybind11::name, pybind11::scope, pybind11::sibling, pybind11::arg, pybind11::arg, pybind11::kw_only, pybind11::arg_v>' requested here
initialize(
^
lib/python3.12/site-packages/pybind11/include/pybind11/pybind11.h:1220:22: note: in instantiation of function template specialization 'pybind11::cpp_function::cpp_function<(lambda at source.cpp:818:6), pybind11::name, pybind11::scope, pybind11::sibling, pybind11::arg, pybind11::arg, pybind11::kw_only, pybind11::arg_v, void>' requested here
cpp_function func(std::forward<Func>(f),
^
source.cpp:816:4: note: in instantiation of function template specialization 'pybind11::module_::def<(lambda at source.cpp:818:6), pybind11::arg, pybind11::arg, pybind11::kw_only, pybind11::arg_v>' requested here
m.def(
^
### Is this a regression? Put the last known working version here if it is.
Not a regression
Required prerequisites
What version (or hash if on master) of pybind11 are you using?
2.12.0Problem description
I am defining a method that takes
py::argsand needs to also accept be able to keyword argumentsI don't want to accept just any keyword argument so I'm not using
py::kwargsThe static assert seems to have a problem with this
Reproducible example code