Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-119010: Adds docs about __type_params__ to functools.update_wrapper #119012

Merged
merged 2 commits into from
May 13, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions Doc/library/functools.rst
Original file line number Diff line number Diff line change
Expand Up @@ -646,8 +646,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__``,
``__doc__``, and ``__type_params__``, the documentation string)
sobolevn marked this conversation as resolved.
Show resolved Hide resolved
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
Expand Down Expand Up @@ -677,6 +678,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)

Expand Down
Loading