Add BaseException.__getitem__ & __getslice__ (#1719)

Refs python/mypy#4215
Fixes false positive

    error: Value of type Exception is not indexable
This commit is contained in:
Alex Willmer
2017-11-07 20:57:51 +00:00
committed by Jelle Zijlstra
parent 735abe68dd
commit c7bc0bdb00

View File

@@ -874,6 +874,9 @@ class BaseException(object):
args = ... # type: Tuple[Any, ...]
message = ... # type: str
def __init__(self, *args: object, **kwargs: object) -> None: ...
def __getitem__(self, i: int) -> Any: ...
def __getslice__(self, start: int, stop: int) -> Tuple[Any, ...]: ...
class GeneratorExit(BaseException): ...
class KeyboardInterrupt(BaseException): ...
class SystemExit(BaseException):