[Python-Dev] Re: [Python-checkins] CVS: python/dist/src/Objects object.c,2.107,2.108

Jeremy Hylton jeremy@alum.mit.edu
Fri, 19 Jan 2001 09:44:50 -0500 (EST)


>>>>> "GvR" == Guido van Rossum <gvanrossum@users.sourceforge.net> writes:

  GvR> Log Message: Changes to recursive-object comparisons, having to
  GvR> do with a test case I found where rich comparison of unequal
  GvR> recursive objects gave unintuituve results.  In a discussion
  GvR> with Tim, where we discovered that our intuition on when a<=b
  GvR> should be true was failing, we decided to outlaw ordering
  GvR> comparisons on recursive objects.  (Once we have fixed our
  GvR> intuition and designed a matching algorithm that's practical
  GvR> and reasonable to implement, we can allow such orderings
  GvR> again.)

Sounds sensible to me!  I was quite puzzled about what <= should
return for recursive objects.

  GvR> - Changed the nesting limit to a more reasonable small 20; this
  GvR>   only slows down comparisons of very deeply nested objects
  GvR>   (unlikely to occur in practice), while speeding up
  GvR>   comparisons of recursive objects (previously, this would
  GvR>   first waste time and space on 500 nested comparisons before
  GvR>   it would start detecting recursion).

After we talked through this code yesterday, I was also thinking that
the limit was too high :-).

Jeremy