Render anyset as set | frozenset as suggested by @sizmailov:

https://github.com/pybind/pybind11/pull/4888#discussion_r1367785281
This commit is contained in:
Ralf W. Grosse-Kunstleve 2023-10-21 12:43:01 -07:00
parent 70a510c305
commit ace70b077f
2 changed files with 2 additions and 2 deletions

View File

@ -889,7 +889,7 @@ struct handle_type_name<dict> {
};
template <>
struct handle_type_name<anyset> {
static constexpr auto name = const_name("set");
static constexpr auto name = const_name("set | frozenset");
};
template <>
struct handle_type_name<set> {

View File

@ -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: set) -> None"
assert doc(m.print_anyset) == "print_anyset(arg0: set | frozenset) -> None"
def test_frozenset(capture, doc):