diff options
| author | Michele Simionato <michele.simionato@gmail.com> | 2010-05-25 05:50:40 +0200 |
|---|---|---|
| committer | Michele Simionato <michele.simionato@gmail.com> | 2010-05-25 05:50:40 +0200 |
| commit | 3a35e9c0fedba403aa7e0c65448dc2ff1800be48 (patch) | |
| tree | 89aa808f19d7f5c3c3b33e10631019f9a9365e58 /documentation.py | |
| parent | aafa3ebb62ba7a1fb108d39d94dcbae8a6502369 (diff) | |
| download | python-decorator-git-3a35e9c0fedba403aa7e0c65448dc2ff1800be48.tar.gz | |
Synchronized documentation.py and documentation3.py
Diffstat (limited to 'documentation.py')
| -rw-r--r-- | documentation.py | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/documentation.py b/documentation.py index acf6641..6827ca9 100644 --- a/documentation.py +++ b/documentation.py @@ -1035,7 +1035,7 @@ def fact(n): # this is not tail-recursive if n == 0: return 1 return n * fact(n-1) -def atest_for_pylons(): +def a_test_for_pylons(): """ In version 3.1.0 decorator(caller) returned a nameless partial object, thus breaking Pylons. That must not happen again. @@ -1043,19 +1043,11 @@ def atest_for_pylons(): >>> decorator(_memoize).__name__ '_memoize' - Here is another bug of version 3.1.1 to avoid: + Here is another bug of version 3.1.1 missing the docstring to avoid: - >>> deprecated.__doc__ - 'A decorator for deprecated functions' + >>> factorial.__doc__ + 'The good old factorial' """ -@decorator -def deprecated(func, *args, **kw): - "A decorator for deprecated functions" - warnings.warn( - 'Calling the deprecated function %r\n' % func.__name__, - DeprecationWarning, stacklevel=3) - return func(*args, **kw) - if __name__ == '__main__': import doctest; doctest.testmod() |
