mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 20:54:28 +08:00
Mark all dunder attributes of BaseException as Optional (#1992)
All of these properties can be set to `None`. Also updates `with_traceback` to only accept the values which can be stored in `__traceback__`
This commit is contained in:
committed by
Jelle Zijlstra
parent
ac70fdc614
commit
6cf1ec9654
@@ -954,11 +954,11 @@ Ellipsis = ... # type: ellipsis
|
||||
|
||||
class BaseException:
|
||||
args = ... # type: Tuple[Any, ...]
|
||||
__cause__ = ... # type: BaseException
|
||||
__context__ = ... # type: BaseException
|
||||
__traceback__ = ... # type: TracebackType
|
||||
__cause__ = ... # type: Optional[BaseException]
|
||||
__context__ = ... # type: Optional[BaseException]
|
||||
__traceback__ = ... # type: Optional[TracebackType]
|
||||
def __init__(self, *args: object, **kwargs: object) -> None: ...
|
||||
def with_traceback(self, tb: Any) -> BaseException: ...
|
||||
def with_traceback(self, tb: Optional[TracebackType]) -> BaseException: ...
|
||||
|
||||
class GeneratorExit(BaseException): ...
|
||||
class KeyboardInterrupt(BaseException): ...
|
||||
|
||||
Reference in New Issue
Block a user