Skip to content

Commit 14cde21

Browse files
Allow subclasses of py::args and py::kwargs
The current implementation does not allow subclasses of args or kwargs. This change allows subclasses to be used.
1 parent 1f8b4a7 commit 14cde21

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/pybind11/cast.h

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

15721572
template <typename Arg>
1573-
using argument_is_args = std::is_same<intrinsic_t<Arg>, args>;
1573+
using argument_is_args = std::is_base_of<args, intrinsic_t<Arg>>;
15741574
template <typename Arg>
1575-
using argument_is_kwargs = std::is_same<intrinsic_t<Arg>, kwargs>;
1575+
using argument_is_kwargs = std::is_base_of<kwargs, intrinsic_t<Arg>>;
15761576
// Get kwargs argument position, or -1 if not present:
15771577
static constexpr auto kwargs_pos = constexpr_last<argument_is_kwargs, Args...>();
15781578

0 commit comments

Comments
 (0)