On 10/30/07, Adam Olsen <[EMAIL PROTECTED]> wrote:
> > I'm actually currently in favor of keeping __cmp__ as it is in Python
> > 2.5.  If a class defines only __cmp__, Python will do the appropriate
> > dance to make <, >, ==, etc. work right.  If a class defines only
> > __eq__, __lt__, etc. Python will do the appropriate dance to make
> > cmp() work right.
>
> For some definition of "right".  A container defines only __cmp__,
> using cmp() internally, will be broken in 3.0.

Sure, but that's their choice.  If you don't want to raise exceptions
on equality comparisons, then you should define __eq__, in addition to
__cmp__.  Or you should only compare against comparable things.

Steve
-- 
I'm not *in*-sane. Indeed, I am so far *out* of sane that you appear a
tiny blip on the distant coast of sanity.
        --- Bucky Katt, Get Fuzzy
_______________________________________________
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