Skip to content

Commit 7c8991a

Browse files
committed
Use Union[set, frozenset] for internal consistency.
1 parent ace70b0 commit 7c8991a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

include/pybind11/cast.h

Lines changed: 1 addition & 1 deletion
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 | frozenset");
892+
static constexpr auto name = const_name("Union[set, frozenset]");
893893
};
894894
template <>
895895
struct handle_type_name<set> {

tests/test_pytypes.py

Lines changed: 1 addition & 1 deletion
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 | frozenset) -> None"
124+
assert doc(m.print_anyset) == "print_anyset(arg0: Union[set, frozenset]) -> None"
125125

126126

127127
def test_frozenset(capture, doc):

0 commit comments

Comments
 (0)