diff options
| author | Michele Simionato <michele.simionato@gmail.com> | 2015-12-09 10:19:54 +0100 |
|---|---|---|
| committer | Michele Simionato <michele.simionato@gmail.com> | 2015-12-09 10:19:54 +0100 |
| commit | 51f1f8057605df65e39649333139e7d55abfd646 (patch) | |
| tree | fbeb5a2150195b161247e764ffa09aa11f2ec0b8 /src/tests/documentation.py | |
| parent | f62d1193eb597c3fb9f47391452d4fbda7613546 (diff) | |
| download | python-decorator-git-51f1f8057605df65e39649333139e7d55abfd646.tar.gz | |
Added a doctest: +ELLIPSIS to fix old Python versions
Diffstat (limited to 'src/tests/documentation.py')
| -rw-r--r-- | src/tests/documentation.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/tests/documentation.py b/src/tests/documentation.py index 69e9f4b..81409fc 100644 --- a/src/tests/documentation.py +++ b/src/tests/documentation.py @@ -1016,10 +1016,10 @@ David Goldstein and here is an example where it is manifest: >>> @memoize ... def getkeys(**kw): ... return kw.keys() - >>> getkeys(func='a') + >>> getkeys(func='a') # doctest: +ELLIPSIS Traceback (most recent call last): ... - TypeError: _memoize() got multiple values for argument 'func' + TypeError: _memoize() got multiple values for ... 'func' The error message looks really strange until you realize that the caller function `_memoize` uses `func` as first argument, @@ -1043,8 +1043,8 @@ follows: return cache[key] We have avoided the need to name the first argument, so the problem -simply disappear. This is a technique that you should keep in mind -when writing decorator for functions with keyword arguments. +simply disappears. This is a technique that you should keep in mind +when writing decorators for functions with keyword arguments. On a similar tone, there is a restriction on the names of the arguments: for instance, if try to call an argument ``_call_`` or |
