diff options
author | Victor Stinner <vstinner@python.org> | 2021-02-18 11:35:37 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-18 11:35:37 (GMT) |
commit | a3c3ffa68e6fc4524b1149a6a14d56c3a2e9b612 (patch) | |
tree | 3dd6f26b5a5fe9b3e2d3bcb0f465bfd28d5bb6b1 /Doc/library/inspect.rst | |
parent | 366dc3a1354078e38808b9c16276e97cca5b8aaf (diff) | |
download | cpython-a3c3ffa68e6fc4524b1149a6a14d56c3a2e9b612.zip cpython-a3c3ffa68e6fc4524b1149a6a14d56c3a2e9b612.tar.gz cpython-a3c3ffa68e6fc4524b1149a6a14d56c3a2e9b612.tar.bz2 |
bpo-42990: Add __builtins__ attribute to functions (GH-24559)
Expose the new PyFunctionObject.func_builtins member in Python as a
new __builtins__ attribute on functions.
Document also the behavior change in What's New in Python 3.10.
Diffstat (limited to 'Doc/library/inspect.rst')
-rw-r--r-- | Doc/library/inspect.rst | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Doc/library/inspect.rst b/Doc/library/inspect.rst index 850d601..1033964 100644 --- a/Doc/library/inspect.rst +++ b/Doc/library/inspect.rst @@ -95,6 +95,8 @@ attributes: | | __globals__ | global namespace in which | | | | this function was defined | +-----------+-------------------+---------------------------+ +| | __builtins__ | builtins namespace | ++-----------+-------------------+---------------------------+ | | __annotations__ | mapping of parameters | | | | names to annotations; | | | | ``"return"`` key is | @@ -251,6 +253,10 @@ attributes: Add ``cr_origin`` attribute to coroutines. +.. versionchanged:: 3.10 + + Add ``__builtins__`` attribute to functions. + .. function:: getmembers(object[, predicate]) Return all the members of an object in a list of ``(name, value)`` |