diff options
| author | Michele Simionato <michele.simionato@gmail.com> | 2010-11-28 09:39:29 +0100 |
|---|---|---|
| committer | Michele Simionato <michele.simionato@gmail.com> | 2010-11-28 09:39:29 +0100 |
| commit | bbe48a4473a806342f3c22a192af3a8d62c81fad (patch) | |
| tree | 148603758b140954c3787c1bdcba1df0fefe56e0 /documentation.py | |
| parent | d5fe6439400b04265d471c5d4a526f103cd78fc2 (diff) | |
| download | python-decorator-git-bbe48a4473a806342f3c22a192af3a8d62c81fad.tar.gz | |
Fixed func_globals in the decorated function (release 3.2.1)
Diffstat (limited to 'documentation.py')
| -rw-r--r-- | documentation.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/documentation.py b/documentation.py index 6827ca9..4e9dfba 100644 --- a/documentation.py +++ b/documentation.py @@ -502,7 +502,7 @@ $$identity_dec <BLANKLINE> (see bug report 1764286_ for an explanation of what is happening). -Unfortunately the bug is still there, even in Python 2.6 and 3.0. +Unfortunately the bug is still there, even in Python 2.7 and 3.1. There is however a workaround. The decorator module adds an attribute ``.undecorated`` to the decorated function, containing a reference to the original function. The easy way to get @@ -710,7 +710,9 @@ you will get a ``NameError``: def f(_func_): return _call_(_func_, _func_) -Finally, the implementation is such that the decorated function contains +Finally, the implementation is such that the decorated function +attribute ``.func_globals`` is a *copy* of the original function +attribute. Moreover the decorated function contains a *copy* of the original function dictionary (``vars(decorated_f) is not vars(f)``): |
