Convert a pile of obvious "yes/no" functions to return bool.

This commit is contained in:
Tim Peters 2002-04-04 22:55:58 +00:00
parent 2f486b7fa6
commit bc0e910826
34 changed files with 117 additions and 122 deletions

View file

@ -196,7 +196,7 @@ class Whitespace:
other.indent_level(ts)) )
return a
# Return true iff self.indent_level(t) < other.indent_level(t)
# Return True iff self.indent_level(t) < other.indent_level(t)
# for all t >= 1.
# The algorithm is due to Vincent Broman.
# Easy to prove it's correct.
@ -211,7 +211,7 @@ class Whitespace:
# Note that M is of the form (T*)(S*) iff len(M.norm[0]) <= 1.
def less(self, other):
if self.n >= other.n:
return 0
return False
if self.is_simple and other.is_simple:
return self.nt <= other.nt
n = max(self.longest_run_of_spaces(),
@ -219,8 +219,8 @@ class Whitespace:
# the self.n >= other.n test already did it for ts=1
for ts in range(2, n+1):
if self.indent_level(ts) >= other.indent_level(ts):
return 0
return 1
return False
return True
# return a list of tuples (ts, i1, i2) such that
# i1 == self.indent_level(ts) >= other.indent_level(ts) == i2.