diff options
author | Nick Coghlan <ncoghlan@gmail.com> | 2013-07-15 11:13:08 (GMT) |
---|---|---|
committer | Nick Coghlan <ncoghlan@gmail.com> | 2013-07-15 11:13:08 (GMT) |
commit | 24c05bc1542d9637550d5253306016412e5119d3 (patch) | |
tree | 12651b54b5479ed65b5b28506098632b7f796464 /Doc/library/functools.rst | |
parent | 6180a2f45321982386200e20bb323eb4261cf1fb (diff) | |
download | cpython-24c05bc1542d9637550d5253306016412e5119d3.zip cpython-24c05bc1542d9637550d5253306016412e5119d3.tar.gz cpython-24c05bc1542d9637550d5253306016412e5119d3.tar.bz2 |
Close issue 17482: don't overwrite __wrapped__
Diffstat (limited to 'Doc/library/functools.rst')
-rw-r--r-- | Doc/library/functools.rst | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/Doc/library/functools.rst b/Doc/library/functools.rst index 3d70955..2f6d9af 100644 --- a/Doc/library/functools.rst +++ b/Doc/library/functools.rst @@ -306,8 +306,8 @@ The :mod:`functools` module defines the following functions: To allow access to the original function for introspection and other purposes (e.g. bypassing a caching decorator such as :func:`lru_cache`), this function - automatically adds a __wrapped__ attribute to the wrapper that refers to - the original function. + automatically adds a ``__wrapped__`` attribute to the wrapper that refers to + the function being wrapped. The main intended use for this function is in :term:`decorator` functions which wrap the decorated function and return the wrapper. If the wrapper function is @@ -330,6 +330,11 @@ The :mod:`functools` module defines the following functions: .. versionchanged:: 3.2 Missing attributes no longer trigger an :exc:`AttributeError`. + .. versionchanged:: 3.4 + The ``__wrapped__`` attribute now always refers to the wrapped + function, even if that function defined a ``__wrapped__`` attribute. + (see :issue:`17482`) + .. decorator:: wraps(wrapped, assigned=WRAPPER_ASSIGNMENTS, updated=WRAPPER_UPDATES) |