mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 04:54:47 +08:00
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:
committed by
Jelle Zijlstra
parent
735abe68dd
commit
c7bc0bdb00
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user