From 4bc477f8d53510bc38cff9534d284137fe9f292a Mon Sep 17 00:00:00 2001 From: fatelei Date: Fri, 19 Dec 2025 20:25:28 +0800 Subject: [PATCH 1/2] gh-142958: add missing document for __function__ --- Doc/library/inspect.rst | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/Doc/library/inspect.rst b/Doc/library/inspect.rst index e5abd68f03b9c3..f4d8db62d3dc18 100644 --- a/Doc/library/inspect.rst +++ b/Doc/library/inspect.rst @@ -113,6 +113,27 @@ attributes (see :ref:`import-mod-attrs` for module attributes): | | | ` of | | | | a generic function | +-----------------+-------------------+---------------------------+ +| | __closure__ | Contains the cells that | +| | | store values for free | +| | | variables (variables from | +| | | outer scopes) used in | +| | | nested functions. | +| | | Essential for | +| | | understanding how closures| +| | | work in Python. | ++-----------------+-------------------+---------------------------+ +| | __dict__ | The namespace dictionary | +| | | that stores arbitrary | +| | | function attributes | +| | | and metadata. | ++-----------------+-------------------+---------------------------+ +| | __annotate__ | The annotate function for | +| | |lazy evaluation of | +| | | annotations (PEP649), or | +| | | None if the function has | +| | | no annotations. New in | +| | |Python 3.14. | ++-----------------+-------------------+---------------------------+ | | __module__ | name of module in which | | | | this function was defined | +-----------------+-------------------+---------------------------+ From 6bd035d1d03a20ff23f7c4c119fd48e6a2aa1e35 Mon Sep 17 00:00:00 2001 From: fatelei Date: Fri, 19 Dec 2025 20:54:23 +0800 Subject: [PATCH 2/2] fix: fix doc warning --- Doc/library/inspect.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/library/inspect.rst b/Doc/library/inspect.rst index f4d8db62d3dc18..adccd27a1172c7 100644 --- a/Doc/library/inspect.rst +++ b/Doc/library/inspect.rst @@ -128,11 +128,11 @@ attributes (see :ref:`import-mod-attrs` for module attributes): | | | and metadata. | +-----------------+-------------------+---------------------------+ | | __annotate__ | The annotate function for | -| | |lazy evaluation of | +| | | lazy evaluation of | | | | annotations (PEP649), or | | | | None if the function has | | | | no annotations. New in | -| | |Python 3.14. | +| | | Python 3.14. | +-----------------+-------------------+---------------------------+ | | __module__ | name of module in which | | | | this function was defined |