Skip to content

Commit 9abd4e3

Browse files
committed
Add NoReturn type to typing stubs
1 parent f6b013b commit 9abd4e3

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

stdlib/2/typing.pyi

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ ClassVar: _SpecialForm = ...
2424

2525
class GenericMeta(type): ...
2626

27+
# Return type that indicates a function does not return.
28+
# This type is equivalent to the None type, but the no-op Union is necessary to
29+
# distinguish the None type from the None value.
30+
NoReturn = typing.Union[None]
31+
2732
# Type aliases and type constructors
2833

2934
class TypeAlias:

stdlib/3/typing.pyi

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ ClassVar: _SpecialForm = ...
2525

2626
class GenericMeta(type): ...
2727

28+
# Return type that indicates a function does not return.
29+
# This type is equivalent to the None type, but the no-op Union is necessary to
30+
# distinguish the None type from the None value.
31+
NoReturn = typing.Union[None]
32+
2833
# Type aliases and type constructors
2934

3035
class TypeAlias:

0 commit comments

Comments
 (0)