8000 [3.13] gh-119010: Adds docs about `__type_params__` to `functools.upd… · python/cpython@d1aac22 · GitHub
[go: up one dir, main page]

Skip to content

Commit d1aac22

Browse files
miss-islingtonsobolevnJelleZijlstra
authored
[3.13] gh-119010: Adds docs about __type_params__ to functools.update_wrapper (GH-119012) (#119013)
gh-119010: Adds docs about `__type_params__` to `functools.update_wrapper` (GH-119012) (cherry picked from commit b04c497) Co-authored-by: Nikita Sobolev <mail@sobolevn.me> Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
1 parent 09d4c07 commit d1aac22

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Doc/library/functools.rst

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -646,8 +646,9 @@ The :mod:`functools` module defines the following functions:
646646
attributes of the wrapper function are updated with the corresponding attributes
647647
from the original function. The default values for these arguments are the
648648
module level constants ``WRAPPER_ASSIGNMENTS`` (which assigns to the wrapper
649-
function's ``__module__``, ``__name__``, ``__qualname__``, ``__annotations__``
650-
and ``__doc__``, the documentation string) and ``WRAPPER_UPDATES`` (which
649+
function's ``__module__``, ``__name__``, ``__qualname__``, ``__annotations__``,
650+
``__type_params__``, and ``__doc__``, the documentation string)
651+
and ``WRAPPER_UPDATES`` (which
651652
updates the wrapper function's ``__dict__``, i.e. the instance dictionary).
652653

653654
To allow access to the original function for introspection and other purposes
@@ -677,6 +678,9 @@ The :mod:`functools` module defines the following functions:
677678
function, even if that function defined a ``__wrapped__`` attribute.
678679
(see :issue:`17482`)
679680

681+
.. versionchanged:: 3.12
682+
The ``__type_params__`` attribute is now copied by default.
683+
680684

681685
.. decorator:: wraps(wrapped, assigned=WRAPPER_ASSIGNMENTS, updated=WRAPPER_UPDATES)
682686

0 commit comments

Comments
 (0)
0