From 01b7002a89c2d484c1cac05e3d89808050fa7459 Mon Sep 17 00:00:00 2001 From: sinancepel Date: Mon, 23 Sep 2019 09:25:49 -0700 Subject: [PATCH] Introduce explicit `__str__` and `__repr__` for Exceptions (#3247) --- stdlib/2/__builtin__.pyi | 2 ++ stdlib/2and3/builtins.pyi | 2 ++ 2 files changed, 4 insertions(+) diff --git a/stdlib/2/__builtin__.pyi b/stdlib/2/__builtin__.pyi index 680f1fd7b..ecaaf4207 100644 --- a/stdlib/2/__builtin__.pyi +++ b/stdlib/2/__builtin__.pyi @@ -1475,6 +1475,8 @@ class BaseException(object): __suppress_context__: bool __traceback__: Optional[TracebackType] def __init__(self, *args: object) -> None: ... + def __str__(self) -> str: ... + def __repr__(self) -> str: ... if sys.version_info < (3,): def __getitem__(self, i: int) -> Any: ... def __getslice__(self, start: int, stop: int) -> Tuple[Any, ...]: ... diff --git a/stdlib/2and3/builtins.pyi b/stdlib/2and3/builtins.pyi index 680f1fd7b..ecaaf4207 100644 --- a/stdlib/2and3/builtins.pyi +++ b/stdlib/2and3/builtins.pyi @@ -1475,6 +1475,8 @@ class BaseException(object): __suppress_context__: bool __traceback__: Optional[TracebackType] def __init__(self, *args: object) -> None: ... + def __str__(self) -> str: ... + def __repr__(self) -> str: ... if sys.version_info < (3,): def __getitem__(self, i: int) -> Any: ... def __getslice__(self, start: int, stop: int) -> Tuple[Any, ...]: ...