Nick Coghlan added the comment:
The best solution is to modify the offending code to use real docstrings.
Failing that, a simple explicit "'\n'.join(line.lstrip('#' for line in
comment.split('\n'))" (i.e. not as part of pydoc) will handle most cases.
Anything more sophisticated would need to
New submission from tkiss80 :
If an entity does not have a docstring, pydoc.getdoc() reads the comment
associated with that entity and uses that as the source of documentation.
However, inspect.getcomments() returns the raw comment with the comment signs
('#') in it, thus the resulting documen