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

Method state_parameter_docstring

Tools/clinic/libclinic/dsl_parser.py:1310–1326  ·  view source on GitHub ↗
(self, line: str)

Source from the content-addressed store, hash-verified

1308 # where F > P.
1309 # these F spaces will be stripped.
1310 def state_parameter_docstring(self, line: str) -> None:
1311 if not self.valid_line(line):
1312 return
1313
1314 indent = self.indent.measure(line)
1315 if indent < self.parameter_docstring_indent:
1316 self.indent.infer(line)
1317 assert self.indent.depth < 3
1318 if self.indent.depth == 2:
1319 # back to a parameter
1320 return self.next(self.state_parameter, line)
1321 assert self.indent.depth == 1
1322 return self.next(self.state_function_docstring, line)
1323
1324 assert self.function and self.function.parameters
1325 last_param = next(reversed(self.function.parameters.values()))
1326 self.docstring_append(last_param, line)
1327
1328 # the final stanza of the DSL is the docstring.
1329 def state_function_docstring(self, line: str) -> None:

Callers

nothing calls this directly

Calls 6

valid_lineMethod · 0.95
nextMethod · 0.95
docstring_appendMethod · 0.95
inferMethod · 0.80
measureMethod · 0.45
valuesMethod · 0.45

Tested by

no test coverage detected