From ccd2206d8f01dc90c53b89cfe879d4c923bd88f2 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Mon, 26 Jan 2026 17:15:47 +0100 Subject: [PATCH] gh-101888: Add function.__builtins__ to ref documentation (GH-144174) (cherry picked from commit 933540e33217474abee3e1b53dec28ad927b6311) Co-authored-by: Victor Stinner --- Doc/reference/datamodel.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst index 0ffc8335790082..3b21fb555155e2 100644 --- a/Doc/reference/datamodel.rst +++ b/Doc/reference/datamodel.rst @@ -541,6 +541,7 @@ Special read-only attributes ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. index:: + single: __builtins__ (function attribute) single: __closure__ (function attribute) single: __globals__ (function attribute) pair: global; namespace @@ -551,6 +552,12 @@ Special read-only attributes * - Attribute - Meaning + * - .. attribute:: function.__builtins__ + - A reference to the :class:`dictionary ` that holds the function's + builtins namespace. + + .. versionadded:: 3.10 + * - .. attribute:: function.__globals__ - A reference to the :class:`dictionary ` that holds the function's :ref:`global variables ` -- the global namespace of the module