Lawrence D'Oliveiro <l...@geek-central.gen.new_zealand> writes: > In message <mailman.2311.1282230005.1673.python-l...@python.org>, Alex Hall > wrote: > >> def __eq__(self, obj): >> if self.a==obj.a and self.b==obj.b: return True >> return False > > Is there a “Useless Use Of ...” award category for these “if <boolean> then > return True; else return False” constructs?
Well, remember that self.a == obj.a can return something other than bool, and the and operator will evaluate to either False or the last value. Maybe he doesn't want to propagate the non-bools out of his __eq__. :) what's-next-"useless-use-of-"useless-use-of...""-ly y'rs -- http://mail.python.org/mailman/listinfo/python-list