En Mon, 17 Nov 2008 16:21:39 -0200, Chris Rebert <[EMAIL PROTECTED]>
escribió:
__cmp__ does rich comparisons and is supposed to return 0 for
equality, -1 if the object is less than the other, and 1 if it's
greater than the other. So, using == as its definition is broken as it
Just a little correction: __cmp__ is the "old" comparison method, the
"rich" comparisons are the six __eq__, __lt__, __gt__, ...
(__cmp__ assumes that any object is either equal, or greater, or less than
another, and no other possibility exists; this isn't true for many
objects, that's why the "rich" methods had to be introduced).
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list