Skip to content

Commit 9d107d2

Browse files
style: pre-commit fixes
1 parent 8cf1cdb commit 9d107d2

File tree

3 files changed

+16
-7
lines changed

3 files changed

+16
-7
lines changed

include/pybind11/cast.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1570,9 +1570,11 @@ class argument_loader {
15701570
using indices = make_index_sequence<sizeof...(Args)>;
15711571

15721572
template <typename Arg>
1573-
using argument_is_args = all_of<std::is_base_of<args, intrinsic_t<Arg>>, negation<std::is_pointer<Arg>>>;
1573+
using argument_is_args
1574+
= all_of<std::is_base_of<args, intrinsic_t<Arg>>, negation<std::is_pointer<Arg>>>;
15741575
template <typename Arg>
1575-
using argument_is_kwargs = all_of<std::is_base_of<kwargs, intrinsic_t<Arg>>, negation<std::is_pointer<Arg>>>;
1576+
using argument_is_kwargs
1577+
= all_of<std::is_base_of<kwargs, intrinsic_t<Arg>>, negation<std::is_pointer<Arg>>>;
15761578
// Get kwargs argument position, or -1 if not present:
15771579
static constexpr auto kwargs_pos = constexpr_last<argument_is_kwargs, Args...>();
15781580

tests/test_kwargs_and_defaults.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ struct handle_type_name<KWArgsSubclass> {
6060
};
6161
template <>
6262
struct type_caster<MoveOrCopyInt> {
63-
PYBIND11_TYPE_CASTER(MoveOrCopyInt*, const_name("MoveOrCopyInt"));
63+
PYBIND11_TYPE_CASTER(MoveOrCopyInt *, const_name("MoveOrCopyInt"));
6464
bool load(handle src, bool) {
6565
auto as_class = MoveOrCopyInt(src.cast<int>());
6666
value = &as_class;
@@ -389,9 +389,10 @@ TEST_SUBMODULE(kwargs_and_defaults, m) {
389389
return py::make_tuple(args, kwargs);
390390
});
391391

392-
// Test that support for args and kwargs subclasses skips checking arguments passed in as pointers
392+
// Test that support for args and kwargs subclasses skips checking arguments passed in as
393+
// pointers
393394
m.def("args_kwargs_subclass_function_with_pointer_arg",
394-
[](MoveOrCopyInt* pointer, const ArgsSubclass &args, const KWArgsSubclass &kwargs) {
395+
[](MoveOrCopyInt *pointer, const ArgsSubclass &args, const KWArgsSubclass &kwargs) {
395396
return py::make_tuple(pointer->value, args, kwargs);
396397
});
397398
}

tests/test_kwargs_and_defaults.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,11 @@ def test_arg_and_kwargs():
107107
kwargs = {"arg3": "a3", "arg4": 4}
108108
assert m.args_kwargs_function(*args, **kwargs) == (args, kwargs)
109109
assert m.args_kwargs_subclass_function(*args, **kwargs) == (args, kwargs)
110-
assert m.args_kwargs_subclass_function_with_pointer_arg(10, *args, **kwargs) == (10, args, kwargs)
110+
assert m.args_kwargs_subclass_function_with_pointer_arg(10, *args, **kwargs) == (
111+
10,
112+
args,
113+
kwargs,
114+
)
111115

112116

113117
def test_mixed_args_and_kwargs(msg):
@@ -429,7 +433,9 @@ def test_args_refcount():
429433
)
430434
assert refcount(myval) == expected
431435

432-
assert m.args_kwargs_subclass_function_with_pointer_arg(7, 8, myval, a=1, b=myval) == (
436+
assert m.args_kwargs_subclass_function_with_pointer_arg(
437+
7, 8, myval, a=1, b=myval
438+
) == (
433439
7,
434440
(8, myval),
435441
{"a": 1, "b": myval},

0 commit comments

Comments
 (0)