G
Gerrit Holl
Hi,
is it proper to compare booleans? It is possible, of course, because
they're compatible with numbers, but booleans aren't truly numbers. I'm
tempted to write:
return cmp(self.extends, other.extends)
instead of
if self.extends and not other.extends:
return 1
else:
return -1
# I've already verified self.extends != other.extends
....but somehow comparing Booleans doesn't feel right...
Is my feeling correct?
(Hmm, makes me wonder, for booleans, are != and ^ equal?)
Gerrit.
is it proper to compare booleans? It is possible, of course, because
they're compatible with numbers, but booleans aren't truly numbers. I'm
tempted to write:
return cmp(self.extends, other.extends)
instead of
if self.extends and not other.extends:
return 1
else:
return -1
# I've already verified self.extends != other.extends
....but somehow comparing Booleans doesn't feel right...
Is my feeling correct?
(Hmm, makes me wonder, for booleans, are != and ^ equal?)
Gerrit.