mirror of
https://github.com/python/cpython.git
synced 2024-11-24 02:15:30 +08:00
#21928: clarify functools.wraps docs.
This commit is contained in:
parent
12b7f48216
commit
67f6d5f4d0
@ -413,9 +413,10 @@ The :mod:`functools` module defines the following functions:
|
||||
|
||||
.. decorator:: wraps(wrapped, assigned=WRAPPER_ASSIGNMENTS, updated=WRAPPER_UPDATES)
|
||||
|
||||
This is a convenience function for invoking ``partial(update_wrapper,
|
||||
wrapped=wrapped, assigned=assigned, updated=updated)`` as a function decorator
|
||||
when defining a wrapper function. For example:
|
||||
This is a convenience function for invoking :func:`update_wrapper` as a
|
||||
function decorator when defining a wrapper function. It is equivalent to
|
||||
``partial(update_wrapper, wrapped=wrapped, assigned=assigned, updated=updated)``.
|
||||
For example::
|
||||
|
||||
>>> from functools import wraps
|
||||
>>> def my_decorator(f):
|
||||
|
Loading…
Reference in New Issue
Block a user