]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] gh-150501: Correct `inspect.getattr_static` docs signature (GH-150504) (#150603)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sat, 30 May 2026 09:26:59 +0000 (11:26 +0200)
committerGitHub <noreply@github.com>
Sat, 30 May 2026 09:26:59 +0000 (09:26 +0000)
gh-150501: Correct `inspect.getattr_static` docs signature (GH-150504)
(cherry picked from commit 678fd8452cc2d7f9a50cb5d4e5ae44a60b724248)

Co-authored-by: Jonathan Dung <jonathandung@yahoo.com>
Doc/library/inspect.rst

index 00e1d77980e080497f4114fbf419ec2d5633bffd..3e0df312f1c8fe7a0383c6d8182fc82faee78785 100644 (file)
@@ -1515,10 +1515,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__`