diff options
| author | Michele Simionato <michele.simionato@gmail.com> | 2015-03-16 15:08:58 +0100 |
|---|---|---|
| committer | Michele Simionato <michele.simionato@gmail.com> | 2015-03-16 15:08:58 +0100 |
| commit | 6f3bf75e285f6632d5be0201d090ea158f18ad7c (patch) | |
| tree | 66aecc0e6b9cd35c9810654725e9a1c37ed7662f /documentation.py | |
| parent | 45f13531def0ea450899f0cd50697d1c79f2bf7a (diff) | |
| download | python-decorator-git-6f3bf75e285f6632d5be0201d090ea158f18ad7c.tar.gz | |
The decorated function dictionary is a copy of the original function dictionary
Diffstat (limited to 'documentation.py')
| -rw-r--r-- | documentation.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/documentation.py b/documentation.py index 1548b5c..0aab054 100644 --- a/documentation.py +++ b/documentation.py @@ -780,9 +780,8 @@ you will get a ``NameError``: Finally, the implementation is such that the decorated function attribute ``.func_globals`` is a *copy* of the original function -attribute. On the other hand the function attribute dictionary -of the decorated function is just a reference to the -original function dictionary, i.e. ``vars(decorated_f) is vars(f)``: +attribute, just as thee attribute dictionary +of the decorated function. .. code-block:: python @@ -795,8 +794,8 @@ original function dictionary, i.e. ``vars(decorated_f) is vars(f)``: >>> traced_f.attr1 'something' >>> traced_f.attr2 = "something different" # setting attr - >>> f.attr2 # the original attribute did change - 'something different' + >>> f.attr2 # the original attribute did not change + 'something else' Compatibility notes --------------------------------------------------------------- |
