summaryrefslogtreecommitdiffstats
path: root/Doc/reference/compound_stmts.rst
diff options
context:
space:
mode:
authorAlex Waygood <Alex.Waygood@Gmail.com>2023-12-11 10:00:42 (GMT)
committerGitHub <noreply@github.com>2023-12-11 10:00:42 (GMT)
commit4c5b9c107a1d158b245f21a1839a2bec97d05383 (patch)
treebc05370d987d9131f6dd0729fb17079f9b03fb7d /Doc/reference/compound_stmts.rst
parent9cdf05bc28c5cd8b000b9541a907028819b3d63e (diff)
downloadcpython-4c5b9c107a1d158b245f21a1839a2bec97d05383.zip
cpython-4c5b9c107a1d158b245f21a1839a2bec97d05383.tar.gz
cpython-4c5b9c107a1d158b245f21a1839a2bec97d05383.tar.bz2
gh-101100: Improve documentation on function attributes (#112933)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Diffstat (limited to 'Doc/reference/compound_stmts.rst')
-rw-r--r--Doc/reference/compound_stmts.rst7
1 files changed, 4 insertions, 3 deletions
diff --git a/Doc/reference/compound_stmts.rst b/Doc/reference/compound_stmts.rst
index 8f64813..7a73509 100644
--- a/Doc/reference/compound_stmts.rst
+++ b/Doc/reference/compound_stmts.rst
@@ -1261,7 +1261,8 @@ except that the original function is not temporarily bound to the name ``func``.
A list of :ref:`type parameters <type-params>` may be given in square brackets
between the function's name and the opening parenthesis for its parameter list.
This indicates to static type checkers that the function is generic. At runtime,
-the type parameters can be retrieved from the function's ``__type_params__``
+the type parameters can be retrieved from the function's
+:attr:`~function.__type_params__`
attribute. See :ref:`generic-functions` for more.
.. versionchanged:: 3.12
@@ -1868,8 +1869,8 @@ like ``TYPE_PARAMS_OF_ListOrSet`` are not actually bound at runtime.
are mappings.
.. [#] A string literal appearing as the first statement in the function body is
- transformed into the function's ``__doc__`` attribute and therefore the
- function's :term:`docstring`.
+ transformed into the function's :attr:`~function.__doc__` attribute and
+ therefore the function's :term:`docstring`.
.. [#] A string literal appearing as the first statement in the class body is
transformed into the namespace's ``__doc__`` item and therefore the class's