Skip to content

Commit 148b8e6

Browse files
authored
[typing] Add NewType.__name__ attribute (#15092)
1 parent 349431d commit 148b8e6

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

stdlib/typing.pyi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,7 @@ if sys.version_info >= (3, 10):
387387
def __or__(self, other: Any) -> _SpecialForm: ...
388388
def __ror__(self, other: Any) -> _SpecialForm: ...
389389
__supertype__: type | NewType
390+
__name__: str
390391

391392
else:
392393
def NewType(name: str, tp: Any) -> Any: ...

stdlib/typing_extensions.pyi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,7 @@ else:
376376
def __init__(self, name: str, tp: AnnotationForm) -> None: ...
377377
def __call__(self, obj: _T, /) -> _T: ...
378378
__supertype__: type | NewType
379+
__name__: str
379380
if sys.version_info >= (3, 10):
380381
def __or__(self, other: Any) -> _SpecialForm: ...
381382
def __ror__(self, other: Any) -> _SpecialForm: ...

0 commit comments

Comments
 (0)