mirror of https://github.com/python/cpython
#21928: merge with 3.4.
This commit is contained in:
commit
cdc7e667d3
|
@ -413,9 +413,10 @@ The :mod:`functools` module defines the following functions:
|
||||||
|
|
||||||
.. decorator:: wraps(wrapped, assigned=WRAPPER_ASSIGNMENTS, updated=WRAPPER_UPDATES)
|
.. decorator:: wraps(wrapped, assigned=WRAPPER_ASSIGNMENTS, updated=WRAPPER_UPDATES)
|
||||||
|
|
||||||
This is a convenience function for invoking ``partial(update_wrapper,
|
This is a convenience function for invoking :func:`update_wrapper` as a
|
||||||
wrapped=wrapped, assigned=assigned, updated=updated)`` as a function decorator
|
function decorator when defining a wrapper function. It is equivalent to
|
||||||
when defining a wrapper function. For example:
|
``partial(update_wrapper, wrapped=wrapped, assigned=assigned, updated=updated)``.
|
||||||
|
For example::
|
||||||
|
|
||||||
>>> from functools import wraps
|
>>> from functools import wraps
|
||||||
>>> def my_decorator(f):
|
>>> def my_decorator(f):
|
||||||
|
|
Loading…
Reference in New Issue