From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Sat, 30 May 2026 09:25:38 +0000 (+0200) Subject: [3.15] gh-150501: Correct `inspect.getattr_static` docs signature (GH-150504) (#150601) X-Git-Tag: v3.15.0b2~41 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=187982aa7d61ec00378498a483c0f92b3992f4be;p=thirdparty%2FPython%2Fcpython.git [3.15] gh-150501: Correct `inspect.getattr_static` docs signature (GH-150504) (#150601) gh-150501: Correct `inspect.getattr_static` docs signature (GH-150504) (cherry picked from commit 678fd8452cc2d7f9a50cb5d4e5ae44a60b724248) Co-authored-by: Jonathan Dung --- diff --git a/Doc/library/inspect.rst b/Doc/library/inspect.rst index 92840e702fbb..a0f7379b12a8 100644 --- a/Doc/library/inspect.rst +++ b/Doc/library/inspect.rst @@ -1614,10 +1614,11 @@ properties, will be invoked and :meth:`~object.__getattr__` and may be called. For cases where you want passive introspection, like documentation tools, this -can be inconvenient. :func:`getattr_static` has the same signature as :func:`getattr` +can be inconvenient. :func:`getattr_static` has a similar signature as :func:`getattr` but avoids executing code when it fetches attributes. -.. function:: getattr_static(obj, attr, default=None) +.. function:: getattr_static(obj, attr) + getattr_static(obj, attr, default) Retrieve attributes without triggering dynamic lookup via the descriptor protocol, :meth:`~object.__getattr__`