mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-25 14:45:12 +00:00
Very minor code style changes, and fixed a typo
This commit is contained in:
parent
bfcf952e01
commit
ab60bf1346
@ -397,7 +397,7 @@ protected:
|
|||||||
/* For each overload:
|
/* For each overload:
|
||||||
1. Copy all positional arguments we were given, also checking to make sure that
|
1. Copy all positional arguments we were given, also checking to make sure that
|
||||||
named positional arguments weren't *also* specified via kwarg.
|
named positional arguments weren't *also* specified via kwarg.
|
||||||
2. If we weren't given enough, try to make up the ommitted ones by checking
|
2. If we weren't given enough, try to make up the omitted ones by checking
|
||||||
whether they were provided by a kwarg matching the `py::arg("name")` name. If
|
whether they were provided by a kwarg matching the `py::arg("name")` name. If
|
||||||
so, use it (and remove it from kwargs; if not, see if the function binding
|
so, use it (and remove it from kwargs; if not, see if the function binding
|
||||||
provided a default that we can use.
|
provided a default that we can use.
|
||||||
@ -466,8 +466,7 @@ protected:
|
|||||||
copied_kwargs = true;
|
copied_kwargs = true;
|
||||||
}
|
}
|
||||||
PyDict_DelItemString(kwargs.ptr(), arg.name);
|
PyDict_DelItemString(kwargs.ptr(), arg.name);
|
||||||
}
|
} else if (arg.value) {
|
||||||
else if (arg.value) {
|
|
||||||
value = arg.value;
|
value = arg.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -492,11 +491,9 @@ protected:
|
|||||||
// We didn't copy out any position arguments from the args_in tuple, so we
|
// We didn't copy out any position arguments from the args_in tuple, so we
|
||||||
// can reuse it directly without copying:
|
// can reuse it directly without copying:
|
||||||
extra_args = reinterpret_borrow<tuple>(args_in);
|
extra_args = reinterpret_borrow<tuple>(args_in);
|
||||||
}
|
} else if (args_copied >= n_args_in) {
|
||||||
else if (args_copied >= n_args_in) {
|
|
||||||
extra_args = tuple(0);
|
extra_args = tuple(0);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
size_t args_size = n_args_in - args_copied;
|
size_t args_size = n_args_in - args_copied;
|
||||||
extra_args = tuple(args_size);
|
extra_args = tuple(args_size);
|
||||||
for (size_t i = 0; i < args_size; ++i) {
|
for (size_t i = 0; i < args_size; ++i) {
|
||||||
|
Loading…
Reference in New Issue
Block a user