Author lregebro
Recipients francescor, javawizard, lregebro, merwok, python-dev, rhettinger
Date 2011-04-19.08:01:57
SpamBayes Score 1.86877e-07
Marked as misclassified No
Message-id <1303200118.67.0.135155677321.issue10042@psf.upfronthosting.co.za>
In-reply-to
Content
Ah! I see how you mean. The problem isn't just if you turn the conversion around from self > other to other < self. The problem in fact appears when a rich text function uses the <>!= operators on self directly.

I tried a version which uses the __xx__ operators directly and that works for the ones that does not use "not". "not NotImplemented" is false, for obvious reasons, and that means that with for example "lambda self, other: not self.__ge__(other)" will return False, when it should return NotImplemented.

In effect this means that the total ordering recipe only works as long as you don't compare two classes that use the total ordering recipe. :-)

I don't think the lambda technique is going to work properly. Of course we can say that we should care about NotImplemented, but then first of all this recipe needs a big "this is broken, don't use it unless you know what you are doing" label, and secondly I don't think it should have been included in the first place if we can't make it work properly.
History
Date User Action Args
2011-04-19 08:01:58lregebrosetrecipients: + lregebro, rhettinger, merwok, francescor, python-dev, javawizard
2011-04-19 08:01:58lregebrosetmessageid: <1303200118.67.0.135155677321.issue10042@psf.upfronthosting.co.za>
2011-04-19 08:01:58lregebrolinkissue10042 messages
2011-04-19 08:01:57lregebrocreate