https://github.com/python/cpython/commit/412c089ed785b01f53ae9de7d863cf5c755db610 commit: 412c089ed785b01f53ae9de7d863cf5c755db610 branch: 3.14 author: Miss Islington (bot) <[email protected]> committer: picnixz <[email protected]> date: 2026-05-30T09:25:55Z summary:
[3.14] gh-150501: Correct `inspect.getattr_static` docs signature (GH-150504) (#150602) gh-150501: Correct `inspect.getattr_static` docs signature (GH-150504) (cherry picked from commit 678fd8452cc2d7f9a50cb5d4e5ae44a60b724248) Co-authored-by: Jonathan Dung <[email protected]> files: M Doc/library/inspect.rst diff --git a/Doc/library/inspect.rst b/Doc/library/inspect.rst index 7a69e246e12cb0..672062e94a6bef 100644 --- a/Doc/library/inspect.rst +++ b/Doc/library/inspect.rst @@ -1574,10 +1574,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__` _______________________________________________ Python-checkins mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3//lists/python-checkins.python.org Member address: [email protected]
