Plea for __eql__

Mikael Olofsson mikael at isy.liu.se
Mon May 22 17:19:34 CEST 2000


On 22-May-00 Remco Gerlich wrote:
 >  Let's give an example. I'm writing a set of functions that have to do with
 >  positions in a chess game. Given two Positions A and B, A != B is obvious
 >  to
 >  implement. But to implement that in Python, I have to define __cmp__ - so
 >  not only do I have to define when two positions are equal, I also have to
 >  define when one is smaller than the other - but that is undefined! '<'
 >  should raise an exception, even though '!=' is reasonable.

Hear, hear!

/Mikael

-----------------------------------------------------------------------
E-Mail:  Mikael Olofsson <mikael at isy.liu.se>
WWW:     http://www.dtr.isy.liu.se/dtr/staff/mikael
Phone:   +46 - (0)13 - 28 1343
Telefax: +46 - (0)13 - 28 1339
Date:    22-May-00
Time:    17:19:19

This message was sent by XF-Mail.
-----------------------------------------------------------------------



More information about the Python-list mailing list