Commit ab60bf13 by Wenzel Jakob

Very minor code style changes, and fixed a typo

parent bfcf952e
...@@ -397,7 +397,7 @@ protected: ...@@ -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: ...@@ -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: ...@@ -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) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment