You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
static_assert(has_arg_annotations || !has_kwonly_args, "py::kwonly requires the use of argument annotations");
195
-
static_assert(has_arg_annotations || !has_pos_only_args, "py::pos_only requires the use of argument annotations (for docstrings and aligning the annotations to the arguments)");
196
-
static_assert(!(has_args && has_kwonly_args), "py::kwonly cannot be combined with a py::args argument");
194
+
static_assert(has_arg_annotations || !has_kw_only_args, "py::kw_only requires the use of argument annotations");
195
+
static_assert(has_arg_annotations || !has_pos_only_args, "py::pos_only requires the use of argument annotations (for docstrings and aligning the annotations to the argument)");
196
+
static_assert(!(has_args && has_kw_only_args), "py::kw_only cannot be combined with a py::args argument");
197
197
}
198
198
199
199
/* Generate a readable signature describing the function's arguments and return value types */
@@ -261,7 +261,7 @@ class cpp_function : public function {
261
261
continue;
262
262
// Separator for keyword-only arguments, placed before the kw
263
263
// arguments start
264
-
if (rec->nargs_kwonly > 0 && arg_index + rec->nargs_kwonly == args)
264
+
if (rec->nargs_kw_only > 0 && arg_index + rec->nargs_kw_only == args)
265
265
signature += "*, ";
266
266
if (arg_index < rec->args.size() && rec->args[arg_index].name) {
267
267
signature += rec->args[arg_index].name;
@@ -522,7 +522,7 @@ class cpp_function : public function {
522
522
size_t num_args = func.nargs; // Number of positional arguments that we need
523
523
if (func.has_args) --num_args; // (but don't count py::args
524
524
if (func.has_kwargs) --num_args; // or py::kwargs)
525
-
size_t pos_args = num_args - func.nargs_kwonly;
525
+
size_t pos_args = num_args - func.nargs_kw_only;
526
526
527
527
if (!func.has_args && n_args_in > pos_args)
528
528
continue; // Too many positional arguments for this overload
0 commit comments