How to generate automatically docs for the c_nested
function?
Background: I do code documentation for other developers and I would like to automatically generate a summary of all class methods included nested functions with short description (docstring).
When I run help(A)
on class A
I get:
Help on class A in module __main__:
class A(builtins.object)
| A(a)
|
| doc A
|
| Methods defined here:
|
| __init__(self, a)
| Initialize self. See
|
| b_method(self)
| doc b_method
Requested output: c_nested()
with docstring: (Docs could be printed event with script, it doesn't need to be printed with pydoc help.)
Help on class A in module __main__:
class A(builtins.object)
| A(a)
|
| doc A
|
| Methods defined here:
|
| __init__(self, a)
| Initialize self. See
|
| b_method(self)
| doc b_method
|
| c_nested()
| doc c_nested
Class example:
class A:
""" doc A """
def __init__(self,a):
self.a = a
def b_method(self):
""" doc b_method """
def c_nested():
"""doc c_nested """
pass
return c_nested()
question from:
https://stackoverflow.com/questions/65860067/how-to-automatically-generate-docstrings-including-nested-functions 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…