[Python-bugs-list] [ python-Bugs-442758 ] 2.2a1: New style classes and __cmp__

noreply@sourceforge.net noreply@sourceforge.net
Thu, 19 Jul 2001 07:50:00 -0700


Bugs item #442758, was opened at 2001-07-19 07:29
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=442758&group_id=5470

>Category: type/class unification
>Group: Python 2.2
Status: Open
Resolution: None
Priority: 6
Submitted By: Walter Dörwald (doerwalter)
Assigned to: Guido van Rossum (gvanrossum)
Summary: 2.2a1: New style classes and __cmp__

Initial Comment:
Implementing __cmp__ in a new style class doesn't seem
to have an effect:
----
class Foo:
   def __cmp__(self, other): 
      print "foo", other
      return 0

class Bar(object):
   def __cmp__(self, other): 
      print "bar", other
      return 0

Foo() == 42
Bar() == 42
----

This only prints:
foo 42


----------------------------------------------------------------------

>Comment By: Guido van Rossum (gvanrossum)
Date: 2001-07-19 07:50

Message:
Logged In: YES 
user_id=6380

Since __cmp__ is being phased out in favor of rich
comparisons, I would consider this a feature.  Do you agree?


----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=442758&group_id=5470