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

Function _strip_final_indent

Lib/_pyrepl/simple_interact.py:55–63  ·  view source on GitHub ↗
(text: str)

Source from the content-addressed store, hash-verified

53
54
55def _strip_final_indent(text: str) -> str:
56 # kill spaces and tabs at the end, but only if they follow '\n'.
57 # meant to remove the auto-indentation only (although it would of
58 # course also remove explicitly-added indentation).
59 short = text.rstrip(" \t")
60 n = len(short)
61 if n > 0 and text[n - 1] == "\n":
62 return short
63 return text
64
65
66def _clear_screen():

Callers 3

more_linesFunction · 0.90
_more_linesFunction · 0.85

Calls 1

rstripMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…