diff --git a/stdlib/builtins.pyi b/stdlib/builtins.pyi index 969d1687611c..1bc46493338c 100644 --- a/stdlib/builtins.pyi +++ b/stdlib/builtins.pyi @@ -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]