Steven Bethard wrote:
> I'm having troubles coming up with things where the *basic* operator
> is really a cmp-like function.

Think of things like comparing a tuple. You need to work your
way along and recursively compare the elements. The decision
about when to stop always involves ==, whatever comparison
you're trying to do. So if e.g. you're doing <, then you have
to test each element first for <, and if that's false, test
it for ==. If the element is itself a tuple, it's doing this
on its elements too, etc., and things get very inefficient.

If you have a single cmp operation that you can apply to the
elements, you only need to do it once for each element and it
gives you all the information you need.

--
Greg
_______________________________________________
Python-3000 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to