This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author lregebro
Recipients eric.araujo, francescor, javawizard, lregebro, python-dev, rhettinger
Date 2011-04-19.08:01:57
SpamBayes Score 1.86877e-07
Marked as misclassified No
Message-id <>
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.
Date User Action Args
2011-04-19 08:01:58lregebrosetrecipients: + lregebro, rhettinger, eric.araujo, francescor, python-dev, javawizard
2011-04-19 08:01:58lregebrosetmessageid: <>
2011-04-19 08:01:58lregebrolinkissue10042 messages
2011-04-19 08:01:57lregebrocreate