MCPcopy Index your code
hub / github.com/python/cpython / splitdoc

Function splitdoc

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

140 return result and re.sub('^ *\n', '', result.rstrip()) or ''
141
142def splitdoc(doc):
143 """Split a doc string into a synopsis line (if any) and the rest."""
144 lines = doc.strip().split('\n')
145 if len(lines) == 1:
146 return lines[0], ''
147 elif len(lines) >= 2 and not lines[1].rstrip():
148 return lines[0], '\n'.join(lines[2:])
149 return '', '\n'.join(lines)
150
151def _getargspec(object):
152 try:

Callers 1

docmoduleMethod · 0.85

Calls 4

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

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…