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

Function _get_this_line_indent

Lib/_pyrepl/readline.py:219–226  ·  view source on GitHub ↗
(buffer: list[str], pos: int)

Source from the content-addressed store, hash-verified

217
218
219def _get_this_line_indent(buffer: list[str], pos: int) -> int:
220 indent = 0
221 while pos > 0 and buffer[pos - 1] in " \t":
222 indent += 1
223 pos -= 1
224 if pos > 0 and buffer[pos - 1] == "\n":
225 return indent
226 return 0
227
228
229def _get_previous_line_indent(buffer: list[str], pos: int) -> tuple[int, int | None]:

Callers 1

doMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…