On 2009-07-02, Paul Rubin <http> wrote: [reformated with emphasis added] > #self.higher and self.lower are each either "available" (i.e. are not > #None), or unavailable (are None). [EMPHASIS] Return the highest of the > #available values. [/EMPHASIS] If no value is available, return None.
Your code doesn't do what your comment says (notice EMPHASIS tags): > if self.higher is not None: > return self.higher > elif self.lower is not None: > return self.lower > else: > return None If lower is 5 and higher is 3, then it returns 3 because 3 != None in the first if. -- http://mail.python.org/mailman/listinfo/python-list