overloading ==
Neil Schemenauer
nas at arctrix.com
Thu Feb 1 22:19:42 EST 2001
On Thu, Feb 01, 2001 at 12:26:11PM -0700, Dave Brueck wrote:
> (you can also define __rcmp__ to handle cases where the object on the left
> side of the conversion doesn't have a cmp method)
Its a lot more complicated that that. Python 2.1 will never call
__rcmp__. Versions of Python older than 2.1 will need __rcmp__
only in some rare cases (that I can't remember at the moment).
Just define __cmp__ and forget about __rcmp__.
Neil
More information about the Python-list
mailing list