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

Method less

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

Source from the content-addressed store, hash-verified

237 # XXXwrite that up.
238 # Note that M is of the form (T*)(S*) iff len(M.norm[0]) <= 1.
239 def less(self, other):
240 if self.n >= other.n:
241 return False
242 if self.is_simple and other.is_simple:
243 return self.nt <= other.nt
244 n = max(self.longest_run_of_spaces(),
245 other.longest_run_of_spaces()) + 1
246 # the self.n >= other.n test already did it for ts=1
247 for ts in range(2, n+1):
248 if self.indent_level(ts) >= other.indent_level(ts):
249 return False
250 return True
251
252 # return a list of tuples (ts, i1, i2) such that
253 # i1 == self.indent_level(ts) >= other.indent_level(ts) == i2.

Callers 1

_process_tokensFunction · 0.80

Calls 2

longest_run_of_spacesMethod · 0.95
indent_levelMethod · 0.95

Tested by

no test coverage detected