PyDocs

Nav

Functional Programming Modules

update_wrapper

functools

function (source)
  • update_wrapper(wrapper, wrapped, assigned=WRAPPER_ASSIGNMENTS, updated=WRAPPER_UPDATES)
Update a wrapper function to look like the wrapped function

wrapper is the function to be updated
wrapped is the original function
assigned is a tuple naming the attributes assigned directly
from the wrapped function to the wrapper function (defaults to
functools.WRAPPER_ASSIGNMENTS)
updated is a tuple naming the attributes of the wrapper that
are updated with the corresponding attribute from the wrapped
function (defaults to functools.WRAPPER_UPDATES)
Changed in 3.2, 3.4, 3.12
  • 3.2: The __wrapped__ attribute is now automatically added. The __annotations__ attribute is now copied by default. Missing attributes no longer trigger an AttributeError.
  • 3.4: The __wrapped__ attribute now always refers to the wrapped function, even if that function defined a __wrapped__ attribute. (see bpo-17482)
  • 3.12: The __type_params__ attribute is now copied by default.
0 Examples
No examples for functools/update_wrapper.
See Also
No see-alsos for functools/update_wrapper
0 Notes
No notes for update_wrapper