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

Function _get_first_indentation

Lib/_pyrepl/readline.py:243–253  ·  view source on GitHub ↗
(buffer: list[str])

Source from the content-addressed store, hash-verified

241
242
243def _get_first_indentation(buffer: list[str]) -> str | None:
244 indented_line_start = None
245 for i in range(len(buffer)):
246 if (i < len(buffer) - 1
247 and buffer[i] == "\n"
248 and buffer[i + 1] in " \t"
249 ):
250 indented_line_start = i + 1
251 elif indented_line_start is not None and buffer[i] not in " \t\n":
252 return ''.join(buffer[indented_line_start : i])
253 return None
254
255
256def _should_auto_indent(buffer: list[str], pos: int) -> bool:

Callers 1

Calls 1

joinMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…