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

Function _rstrip

Tools/patchcheck/reindent.py:160–171  ·  view source on GitHub ↗

Return line stripped of trailing spaces, tabs, newlines. Note that line.rstrip() instead also strips sundry control characters, but at least one known Emacs user expects to keep junk like that, not mentioning Barry by name or anything .

(line, JUNK='\n \t')

Source from the content-addressed store, hash-verified

158
159
160def _rstrip(line, JUNK='\n \t'):
161 """Return line stripped of trailing spaces, tabs, newlines.
162
163 Note that line.rstrip() instead also strips sundry control characters,
164 but at least one known Emacs user expects to keep junk like that, not
165 mentioning Barry by name or anything <wink>.
166 """
167
168 i = len(line)
169 while i > 0 and line[i - 1] in JUNK:
170 i -= 1
171 return line[:i]
172
173
174class Reindenter:

Callers 1

__init__Method · 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…