diff --git a/include/pybind11/cast.h b/include/pybind11/cast.h index 9da63772e..af6705b62 100644 --- a/include/pybind11/cast.h +++ b/include/pybind11/cast.h @@ -888,6 +888,10 @@ struct handle_type_name { static constexpr auto name = const_name("dict"); }; template <> +struct handle_type_name { + static constexpr auto name = const_name("set"); +}; +template <> struct handle_type_name { static constexpr auto name = const_name("set"); }; @@ -896,10 +900,6 @@ struct handle_type_name { static constexpr auto name = const_name("frozenset"); }; template <> -struct handle_type_name { - static constexpr auto name = const_name("anyset"); -}; -template <> struct handle_type_name { static constexpr auto name = const_name("str"); }; diff --git a/tests/test_pytypes.py b/tests/test_pytypes.py index 2b2027316..2824d29f9 100644 --- a/tests/test_pytypes.py +++ b/tests/test_pytypes.py @@ -121,7 +121,7 @@ def test_set(capture, doc): assert m.anyset_contains({"foo"}, "foo") assert doc(m.get_set) == "get_set() -> set" - assert doc(m.print_anyset) == "print_anyset(arg0: anyset) -> None" + assert doc(m.print_anyset) == "print_anyset(arg0: set) -> None" def test_frozenset(capture, doc):