Skip to content

Commit dba2c53

Browse files
authored
Type Sentinel properly
1 parent e7da3a6 commit dba2c53

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

stdlib/typing_extensions.pyi

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -692,4 +692,7 @@ else:
692692
) -> AnnotationForm: ...
693693

694694
# PEP 661
695-
Sentinel: _SpecialForm
695+
class Sentinel:
696+
def __init__(self, name: str, repr: str | None = None) -> None: ...
697+
def __or__(self, other: Any) -> UnionType: ... # other can be any type form legal for unions
698+
def __ror__(self, other: Any) -> UnionType: ... # other can be any type form legal for unions

0 commit comments

Comments
 (0)