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

Method expand_tabs

Lib/difflib.py:1794–1802  ·  view source on GitHub ↗
(line)

Source from the content-addressed store, hash-verified

1792 characters will be replaced with a nonbreakable space.
1793 """
1794 def expand_tabs(line):
1795 # hide real spaces
1796 line = line.replace(' ','\0')
1797 # expand tabs into spaces
1798 line = line.expandtabs(self._tabsize)
1799 # replace spaces from expanded tabs back into tab characters
1800 # (we'll replace them with markup after we do differencing)
1801 line = line.replace(' ','\t')
1802 return line.replace('\0',' ').rstrip('\n')
1803 fromlines = [expand_tabs(line) for line in fromlines]
1804 tolines = [expand_tabs(line) for line in tolines]
1805 return fromlines,tolines

Callers

nothing calls this directly

Calls 3

replaceMethod · 0.45
expandtabsMethod · 0.45
rstripMethod · 0.45

Tested by

no test coverage detected