On 10/17/07, David A. Wheeler <[EMAIL PROTECTED]> wrote:
> I said:
> > I agree with Collin Winter: losing __cmp__ is a loss  (see 
> > http://oakwinter.com/code/).
>
> Steven Bethard said:
> >Why can't this just be supplied with a mixin?  Here's a recipe
> >providing the appropriate mixins if you want to define a __key__
> >function:
> >    http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/510403
>
> That _works_ from a functional perspective, and if Python3 fails to include 
> direct support for __cmp__, then I think providing a built-in mixin is 
> necessary.
>
> But mixins for comparison are a BIG LOSER for sort performance if your 
> fundamental operator is a cmp-like function.

However, note that Python's sort() and sorted() are guaranteed to only use '<'.

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)
_______________________________________________
Python-3000 mailing list
Python-3000@python.org
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