I'm actually doing.
I have a special-purpose class with a __cmp__ method all set up and
ready to go for sorting. Then I have a special class that is based on
the builtin type list (though I didn't actually inherit list; I
probably should). When I create an instance with 2 or more items, and
attempt to sort it, I get this strange error message:
Traceback (most recent call last):>>myList.sort ()
File "<console>" , line 1, in <module>
File "[listModulePath]", line 239, in sort
self.listOfObje cts.sort()
TypeError: an integer is required
The sort method's code is exactly what you see; it's a one-line method.
The only thing I can think of is the __cmp__ method is returning
something other than an integer, which it's not.