MCPcopy Index your code
hub / github.com/RustPython/RustPython / _strip_final_indent

Function _strip_final_indent

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

Source from the content-addressed store, hash-verified

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

Callers 2

_more_linesFunction · 0.85

Calls 2

lenFunction · 0.85
rstripMethod · 0.45

Tested by

no test coverage detected