summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichele Simionato <michele.simionato@gmail.com>2010-05-25 05:50:40 +0200
committerMichele Simionato <michele.simionato@gmail.com>2010-05-25 05:50:40 +0200
commitcc0d91173f99442ac3b739f7a1201ca82c335bca (patch)
tree40e0e16c4df8d117bd7158b4315f57a6236548d8
parent58fb904527eb26a868cd03ffd44832283c38995a (diff)
downloadmicheles-cc0d91173f99442ac3b739f7a1201ca82c335bca.tar.gz
Synchronized documentation.py and documentation3.py
-rw-r--r--decorator/documentation.py16
1 files changed, 4 insertions, 12 deletions
diff --git a/decorator/documentation.py b/decorator/documentation.py
index acf6641..6827ca9 100644
--- a/decorator/documentation.py
+++ b/decorator/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()