Get the documentation string for an object. All tabs are expanded to spaces. To clean up docstrings that are indented to line up with blocks of code, any whitespace than can be uniformly removed from the second line onwards is removed.
(object)
| 184 | return None |
| 185 | |
| 186 | def _getdoc(object): |
| 187 | """Get the documentation string for an object. |
| 188 | |
| 189 | All tabs are expanded to spaces. To clean up docstrings that are |
| 190 | indented to line up with blocks of code, any whitespace than can be |
| 191 | uniformly removed from the second line onwards is removed.""" |
| 192 | doc = _getowndoc(object) |
| 193 | if doc is None: |
| 194 | try: |
| 195 | doc = _finddoc(object) |
| 196 | except (AttributeError, TypeError): |
| 197 | return None |
| 198 | if not isinstance(doc, str): |
| 199 | return None |
| 200 | return inspect.cleandoc(doc) |
| 201 | |
| 202 | def getdoc(object): |
| 203 | """Get the doc string or comments for an object.""" |
no test coverage detected