MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / splitdoc

Function splitdoc

tools/python-3.11.9-amd64/Lib/pydoc.py:191–198  ·  view source on GitHub ↗

Split a doc string into a synopsis line (if any) and the rest.

(doc)

Source from the content-addressed store, hash-verified

189 return result and re.sub('^ *\n', '', result.rstrip()) or ''
190
191def splitdoc(doc):
192 """Split a doc string into a synopsis line (if any) and the rest."""
193 lines = doc.strip().split('\n')
194 if len(lines) == 1:
195 return lines[0], ''
196 elif len(lines) >= 2 and not lines[1].rstrip():
197 return lines[0], '\n'.join(lines[2:])
198 return '', '\n'.join(lines)
199
200def classname(object, modname):
201 """Get a class name and qualify it with a module name if necessary."""

Callers 1

docmoduleMethod · 0.85

Calls 4

stripMethod · 0.80
splitMethod · 0.45
rstripMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected