MCPcopy Create free account
hub / github.com/python/cpython / not_less_witness

Method not_less_witness

Lib/tabnanny.py:256–265  ·  view source on GitHub ↗
(self, other)

Source from the content-addressed store, hash-verified

254 # Intended to be used after not self.less(other) is known, in which
255 # case it will return at least one witnessing tab size.
256 def not_less_witness(self, other):
257 n = max(self.longest_run_of_spaces(),
258 other.longest_run_of_spaces()) + 1
259 a = []
260 for ts in range(1, n+1):
261 if self.indent_level(ts) >= other.indent_level(ts):
262 a.append( (ts,
263 self.indent_level(ts),
264 other.indent_level(ts)) )
265 return a
266
267def format_witnesses(w):
268 firsts = (str(tup[0]) for tup in w)

Callers 1

_process_tokensFunction · 0.80

Calls 3

longest_run_of_spacesMethod · 0.95
indent_levelMethod · 0.95
appendMethod · 0.45

Tested by

no test coverage detected