MCPcopy Index your code
hub / github.com/RustPython/RustPython / splitdoc

Function splitdoc

Lib/pydoc.py:207–214  ·  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

205 return result and re.sub('^ *\n', '', result.rstrip()) or ''
206
207def splitdoc(doc):
208 """Split a doc string into a synopsis line (if any) and the rest."""
209 lines = doc.strip().split('\n')
210 if len(lines) == 1:
211 return lines[0], ''
212 elif len(lines) >= 2 and not lines[1].rstrip():
213 return lines[0], '\n'.join(lines[2:])
214 return '', '\n'.join(lines)
215
216def _getargspec(object):
217 try:

Callers 1

docmoduleMethod · 0.85

Calls 5

lenFunction · 0.85
splitMethod · 0.45
stripMethod · 0.45
rstripMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected