From: moerchendiser2k3 on 1 Jul 2010 05:52
just another question. Can anyone explain me whats the real difference
between tp_richcompare and tp_compare? I read some stuff, but
sometimes I believe the author doesnt know either whats the real
difference or they forget it to explain. The Function definition looks
very similiar, except the one accepts POD types as return value, the
other wants the same for PyObjects.
Do I need to implement both? Looks very redundant, isnt it? Or is it
just an extension and tp_richcompare is the better choice here? Can
anyone please make the light on here? :)
Really thanks in advance for your help!!
From: Aahz on 2 Jul 2010 21:30
In article <d52edb82-4de5-496d-8807-b5d15ee66195(a)i31g2000yqm.googlegroups.com>,
moerchendiser2k3 <googler.1.webmaster(a)spamgourmet.com> wrote:
>Do I need to implement both? Looks very redundant, isnt it? Or is it
>just an extension and tp_richcompare is the better choice here? Can
>anyone please make the light on here? :)
Nobody else responded, so please take this non-expert advice:
tp_compare is the older and now deprecated slot; you want to use
tp_richcompare if you don't need to support older versions of Python.
Don't implement both.
Aahz (aahz(a)pythoncraft.com) <*> http://www.pythoncraft.com/
"If you don't know what your program is supposed to do, you'd better not
start writing it." --Dijkstra