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

noreply@sourceforge.net noreply@sourceforge.net
Thu, 19 Jul 2001 07:37:35 -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: None
Group: None
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


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

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