Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions Lib/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,24 @@ def stop() -> NoReturn:
"""
raise TypeError(f"{self} is not subscriptable")

@_SpecialForm
def Void(self, parameters):
"""Special type indicating functions that do not return values.
Example::

from typing import Void, Any

def nothing() -> Void:
pass

nothing() #passes type checking
a: Any = nothing() #fails type checking

This type is invalid in any context other than a function/method return
type annotation, e.g., ``List[Void]`` will fail in static type checkers.
"""
raise TypeError(f"{self} is not subscriptable")

@_SpecialForm
def ClassVar(self, parameters):
"""Special type construct to mark class variables.
Expand Down