I'm trying to document a decorator, but am not sure where the doc string should go. Technically, it's the inner wrapper that contains the parameters I want to document, but a user is going to be applying the outer function name as the decorator.
For example,
def change_case(func):
"""Does the doc string go here
"""
def _wrapper(s, case=None):
"""Or, does the doc string go here?
"""
if case == 'Upper':
s = s.upper()
elif case == 'Lower':
s = s.lower()
return func(s)
return _wrapper
@change_case
def echo(s):
return s
echo('Test', case='Upper')
In the above, does the doc string go after change_case() or _wrapper(). I'm leaning towards the former.