Add explicit definition for __repr__ and __str__ in BaseException (#14900)

This commit is contained in:
Maxime Arthaud
2025-10-20 15:17:08 +02:00
committed by GitHub
parent 11e7d904b9
commit 4c4f999717
+4
View File
@@ -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]