@@ -59,43 +59,6 @@ def from_params(cls, params):
5959 return result
6060
6161
62- @cbook .deprecated ("3.1" )
63- class Appender :
64- r"""
65- A function decorator that will append an addendum to the docstring
66- of the target function.
67-
68- This decorator should be robust even if func.__doc__ is None
69- (for example, if -OO was passed to the interpreter).
70-
71- Usage: construct a docstring.Appender with a string to be joined to
72- the original docstring. An optional 'join' parameter may be supplied
73- which will be used to join the docstring and addendum. e.g.
74-
75- add_copyright = Appender("Copyright (c) 2009", join='\n')
76-
77- @add_copyright
78- def my_dog(has='fleas'):
79- "This docstring will have a copyright below"
80- pass
81- """
82- def __init__ (self , addendum , join = '' ):
83- self .addendum = addendum
84- self .join = join
85-
86- def __call__ (self , func ):
87- docitems = [func .__doc__ , self .addendum ]
88- func .__doc__ = func .__doc__ and self .join .join (docitems )
89- return func
90-
91-
92- @cbook .deprecated ("3.1" , alternative = "inspect.getdoc()" )
93- def dedent (func ):
94- "Dedent a docstring (if present)"
95- func .__doc__ = func .__doc__ and cbook .dedent (func .__doc__ )
96- return func
97-
98-
9962def copy (source ):
10063 "Copy a docstring from another source function (if present)"
10164 def do_copy (target ):
@@ -114,14 +77,3 @@ def dedent_interpd(func):
11477 """Dedent *func*'s docstring, then interpolate it with ``interpd``."""
11578 func .__doc__ = inspect .getdoc (func )
11679 return interpd (func )
117-
118-
119- @cbook .deprecated ("3.1" , alternative = "docstring.copy() and cbook.dedent()" )
120- def copy_dedent (source ):
121- """A decorator that will copy the docstring from the source and
122- then dedent it"""
123- # note the following is ugly because "Python is not a functional
124- # language" - GVR. Perhaps one day, functools.compose will exist.
125- # or perhaps not.
126- # http://mail.python.org/pipermail/patches/2007-February/021687.html
127- return lambda target : dedent (copy (source )(target ))
0 commit comments