Add NoReturn (#811)

* Add NoReturn
This commit is contained in:
David Fisher
2017-01-04 13:38:05 -08:00
committed by Łukasz Langa
parent 93bb4604cb
commit 2cb8e184cc
9 changed files with 22 additions and 9 deletions

View File

@@ -8,6 +8,7 @@ from typing import (
TypeVar, Callable, Type,
)
from types import TracebackType
from mypy_extensions import NoReturn
_T = TypeVar('_T')
@@ -120,7 +121,7 @@ def exc_info() -> Tuple[Optional[Type[BaseException]],
Optional[BaseException],
Optional[TracebackType]]: ...
# sys.exit() accepts an optional argument of anything printable
def exit(arg: Any = ...) -> None:
def exit(arg: Any = ...) -> NoReturn:
raise SystemExit()
def getcheckinterval() -> int: ... # deprecated
def getdefaultencoding() -> str: ...