What are some good ways to deal with repetitive content in docstrings? I have many functions that take “standard” arguments, which should be explained in docstring, but it would be nice to write the corresponding parts of docstring only once, as that would be much easier to maintain and update. I naively tried the following:
arg_a = "a: a very common argument"
def test(a):
'''
Arguments:
%s
''' % arg_a
pass
But this does not work, because when I do help(test), I do not see a docstring. Is there a good way to do this?
source
share