MCPcopy Index your code
hub / github.com/RustPython/RustPython / less

Method less

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

Source from the content-addressed store, hash-verified

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

Callers 1

_process_tokensFunction · 0.80

Calls 3

longest_run_of_spacesMethod · 0.95
indent_levelMethod · 0.95
maxFunction · 0.85

Tested by

no test coverage detected