Skip to content

Commit ace70b0

Browse files
committed
Render anyset as set | frozenset as suggested by @sizmailov:
#4888 (comment)
1 parent 70a510c commit ace70b0

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

include/pybind11/cast.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -889,7 +889,7 @@ struct handle_type_name<dict> {
889889
};
890890
template <>
891891
struct handle_type_name<anyset> {
892-
static constexpr auto name = const_name("set");
892+
static constexpr auto name = const_name("set | frozenset");
893893
};
894894
template <>
895895
struct handle_type_name<set> {

tests/test_pytypes.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def test_set(capture, doc):
121121
assert m.anyset_contains({"foo"}, "foo")
122122

123123
assert doc(m.get_set) == "get_set() -> set"
124-
assert doc(m.print_anyset) == "print_anyset(arg0: set) -> None"
124+
assert doc(m.print_anyset) == "print_anyset(arg0: set | frozenset) -> None"
125125

126126

127127
def test_frozenset(capture, doc):

0 commit comments

Comments
 (0)