From bc4b26fbcb1488325ee70cb745981ebd89384b86 Mon Sep 17 00:00:00 2001 From: bzoracler <50305397+bzoracler@users.noreply.github.com> Date: Sun, 7 Apr 2024 22:15:51 +1200 Subject: [PATCH] Allow `NewType.__supertype__` to also be a `NewType` (#11728) --- stdlib/typing.pyi | 2 +- stdlib/typing_extensions.pyi | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/stdlib/typing.pyi b/stdlib/typing.pyi index 901e00efb..580322b65 100644 --- a/stdlib/typing.pyi +++ b/stdlib/typing.pyi @@ -290,7 +290,7 @@ if sys.version_info >= (3, 10): def __or__(self, other: Any) -> _SpecialForm: ... def __ror__(self, other: Any) -> _SpecialForm: ... - __supertype__: type + __supertype__: type | NewType else: def NewType(name: str, tp: Any) -> Any: ... diff --git a/stdlib/typing_extensions.pyi b/stdlib/typing_extensions.pyi index 5bcfa5a08..48a398ba4 100644 --- a/stdlib/typing_extensions.pyi +++ b/stdlib/typing_extensions.pyi @@ -374,7 +374,7 @@ else: class NewType: def __init__(self, name: str, tp: Any) -> None: ... def __call__(self, obj: _T, /) -> _T: ... - __supertype__: type + __supertype__: type | NewType if sys.version_info >= (3, 10): def __or__(self, other: Any) -> _SpecialForm: ... def __ror__(self, other: Any) -> _SpecialForm: ...