Skip to content

Commit

Permalink
Render anyset as set | frozenset as suggested by @sizmailov:
Browse files Browse the repository at this point in the history
  • Loading branch information
Ralf W. Grosse-Kunstleve committed Oct 21, 2023
1 parent 70a510c commit ace70b0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion include/pybind11/cast.h
Original file line number Diff line number Diff line change
Expand Up @@ -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> {
Expand Down
2 changes: 1 addition & 1 deletion tests/test_pytypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit ace70b0

Please sign in to comment.