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

Method add_whitespace

Lib/tokenize.py:175–183  ·  view source on GitHub ↗
(self, start)

Source from the content-addressed store, hash-verified

173 self.encoding = None
174
175 def add_whitespace(self, start):
176 row, col = start
177 if row < self.prev_row or row == self.prev_row and col < self.prev_col:
178 raise ValueError("start ({},{}) precedes previous end ({},{})"
179 .format(row, col, self.prev_row, self.prev_col))
180 self.add_backslash_continuation(start)
181 col_offset = col - self.prev_col
182 if col_offset:
183 self.tokens.append(" " * col_offset)
184
185 def add_backslash_continuation(self, start):
186 """Add backslash continuation characters if the row has increased

Callers 3

untokenizeMethod · 0.95
test_bad_input_orderMethod · 0.95

Calls 3

formatMethod · 0.45
appendMethod · 0.45

Tested by 2

test_bad_input_orderMethod · 0.76