mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-05-06 21:43:59 +08:00
Add explicit definition for __repr__ and __str__ in BaseException (#14900)
This commit is contained in:
@@ -2058,6 +2058,10 @@ class BaseException:
|
||||
def __new__(cls, *args: Any, **kwds: Any) -> Self: ...
|
||||
def __setstate__(self, state: dict[str, Any] | None, /) -> None: ...
|
||||
def with_traceback(self, tb: TracebackType | None, /) -> Self: ...
|
||||
# Necessary for security-focused static analyzers (e.g, pysa)
|
||||
# See https://github.com/python/typeshed/pull/14900
|
||||
def __str__(self) -> str: ... # noqa: Y029
|
||||
def __repr__(self) -> str: ... # noqa: Y029
|
||||
if sys.version_info >= (3, 11):
|
||||
# only present after add_note() is called
|
||||
__notes__: list[str]
|
||||
|
||||
Reference in New Issue
Block a user