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

Method _munge_whitespace

Lib/textwrap.py:143–154  ·  view source on GitHub ↗

_munge_whitespace(text : string) -> string Munge whitespace in text: expand tabs and convert all other whitespace characters to spaces. Eg. " foo\\tbar\\n\\nbaz" becomes " foo bar baz".

(self, text)

Source from the content-addressed store, hash-verified

141 # (possibly useful for subclasses to override)
142
143 def _munge_whitespace(self, text):
144 """_munge_whitespace(text : string) -> string
145
146 Munge whitespace in text: expand tabs and convert all other
147 whitespace characters to spaces. Eg. " foo\\tbar\\n\\nbaz"
148 becomes " foo bar baz".
149 """
150 if self.expand_tabs:
151 text = text.expandtabs(self.tabsize)
152 if self.replace_whitespace:
153 text = text.translate(self.unicode_whitespace_trans)
154 return text
155
156
157 def _split(self, text):

Callers 1

_split_chunksMethod · 0.95

Calls 2

expandtabsMethod · 0.45
translateMethod · 0.45

Tested by

no test coverage detected