[typing] Add NewType.__name__ attribute (#15092)

This commit is contained in:
Guo Ci
2025-11-28 17:12:15 -05:00
committed by GitHub
parent 349431d92d
commit 148b8e631d
2 changed files with 2 additions and 0 deletions
+1
View File
@@ -387,6 +387,7 @@ if sys.version_info >= (3, 10):
def __or__(self, other: Any) -> _SpecialForm: ...
def __ror__(self, other: Any) -> _SpecialForm: ...
__supertype__: type | NewType
__name__: str
else:
def NewType(name: str, tp: Any) -> Any: ...
+1
View File
@@ -376,6 +376,7 @@ else:
def __init__(self, name: str, tp: AnnotationForm) -> None: ...
def __call__(self, obj: _T, /) -> _T: ...
__supertype__: type | NewType
__name__: str
if sys.version_info >= (3, 10):
def __or__(self, other: Any) -> _SpecialForm: ...
def __ror__(self, other: Any) -> _SpecialForm: ...