Author amaury.forgeotdarc
Recipients amaury.forgeotdarc, benjamin.peterson, brett.cannon, christian.heimes, georg.brandl, gvanrossum, mark.dickinson, rhettinger
Date 2008-12-07.00:23:10
SpamBayes Score 2.1548e-06
Marked as misclassified No
Message-id <1228609392.36.0.353480655221.issue1717@psf.upfronthosting.co.za>
In-reply-to
Content
tp_richcompare is less convenient to implement than tp_compare. See for 
example how in Objects/longobject.c, long_richcompare() calls long_compare() *and* a helper method Py_CmpToRich.

Likewise, turning __cmp__ into the whole set of __lt__, __le__, __ge__, 
__gt__, __eq__, __ne__ methods (did I forget one?) is tedious.

I'm not talking for my own code, but for the python standard objects and 
library (and the Demo directory) where I'm currently trying to remove 
__cmp__ and tp_compare.

I am not far to write a hack (mixin, metaclass) to inject rich 
comparison functions based on a single __cmp__ function.
History
Date User Action Args
2008-12-07 00:23:12amaury.forgeotdarcsetrecipients: + amaury.forgeotdarc, gvanrossum, brett.cannon, georg.brandl, rhettinger, mark.dickinson, christian.heimes, benjamin.peterson
2008-12-07 00:23:12amaury.forgeotdarcsetmessageid: <1228609392.36.0.353480655221.issue1717@psf.upfronthosting.co.za>
2008-12-07 00:23:11amaury.forgeotdarclinkissue1717 messages
2008-12-07 00:23:10amaury.forgeotdarccreate