summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2024-05-13 20:16:54 (GMT)
committerGitHub <noreply@github.com>2024-05-13 20:16:54 (GMT)
commit275ec3917e12353d51d60149ebe711166822c423 (patch)
treec861acd0d9b14ddde19d2ce6f4fed32a5e45658e /Doc
parentfcdd20ef83e099a227eba5692fffcec1c8b9031b (diff)
downloadcpython-275ec3917e12353d51d60149ebe711166822c423.zip
cpython-275ec3917e12353d51d60149ebe711166822c423.tar.gz
cpython-275ec3917e12353d51d60149ebe711166822c423.tar.bz2
[3.12] gh-119010: Adds docs about `__type_params__` to `functools.update_wrapper` (GH-119012) (#119014)
gh-119010: Adds docs about `__type_params__` to `functools.update_wrapper` (GH-119012) (cherry picked from commit b04c497f187b0b474e431a6d8d282269b40ffe52) Co-authored-by: Nikita Sobolev <mail@sobolevn.me> Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/functools.rst8
1 files changed, 6 insertions, 2 deletions
diff --git a/Doc/library/functools.rst b/Doc/library/functools.rst
index 1fb716f..655e05f 100644
--- a/Doc/library/functools.rst
+++ b/Doc/library/functools.rst
@@ -644,8 +644,9 @@ The :mod:`functools` module defines the following functions:
attributes of the wrapper function are updated with the corresponding attributes
from the original function. The default values for these arguments are the
module level constants ``WRAPPER_ASSIGNMENTS`` (which assigns to the wrapper
- function's ``__module__``, ``__name__``, ``__qualname__``, ``__annotations__``
- and ``__doc__``, the documentation string) and ``WRAPPER_UPDATES`` (which
+ function's ``__module__``, ``__name__``, ``__qualname__``, ``__annotations__``,
+ ``__type_params__``, and ``__doc__``, the documentation string)
+ and ``WRAPPER_UPDATES`` (which
updates the wrapper function's ``__dict__``, i.e. the instance dictionary).
To allow access to the original function for introspection and other purposes
@@ -675,6 +676,9 @@ The :mod:`functools` module defines the following functions:
function, even if that function defined a ``__wrapped__`` attribute.
(see :issue:`17482`)
+ .. versionchanged:: 3.12
+ The ``__type_params__`` attribute is now copied by default.
+
.. decorator:: wraps(wrapped, assigned=WRAPPER_ASSIGNMENTS, updated=WRAPPER_UPDATES)