Skip to content

Commit

Permalink
Allow subclasses of py::args and py::kwargs
Browse files Browse the repository at this point in the history
The current implementation does not allow subclasses of args or kwargs.
This change allows subclasses to be used.
  • Loading branch information
gentlegiantJGC committed Sep 20, 2024
1 parent 1f8b4a7 commit 14cde21
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/pybind11/cast.h
Original file line number Diff line number Diff line change
Expand Up @@ -1570,9 +1570,9 @@ class argument_loader {
using indices = make_index_sequence<sizeof...(Args)>;

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

Expand Down

0 comments on commit 14cde21

Please sign in to comment.