Get the doc string or comments for an object.
(object)
| 200 | return inspect.cleandoc(doc) |
| 201 | |
| 202 | def getdoc(object): |
| 203 | """Get the doc string or comments for an object.""" |
| 204 | result = _getdoc(object) or inspect.getcomments(object) |
| 205 | return result and re.sub('^ *\n', '', result.rstrip()) or '' |
| 206 | |
| 207 | def splitdoc(doc): |
| 208 | """Split a doc string into a synopsis line (if any) and the rest.""" |