Re: tp_richcompare vs tp_compare

2010-07-02 Thread Aahz
In article , moerchendiser2k3 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_richcompare vs tp_compare

2010-07-01 Thread moerchendiser2k3
Hi all, 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

Re: tp_richcompare

2006-06-02 Thread Ziga Seilnacht
Sreeram Kandallu wrote: > I'm writing an extension type, for which i'd like to implement only == > and !=, but not the other comparison operators like <,<=,>,>=. > What is the right way to do this? > I currently have a tp_richcompare function, which handle

tp_richcompare

2006-06-02 Thread Sreeram Kandallu
I'm writing an extension type, for which i'd like to implement only == and !=, but not the other comparison operators like <,<=,>,>=. What is the right way to do this? I currently have a tp_richcompare function, which handles Py_EQ, and Py_NE, but raises a TypeError for th

dependencies on subclassing Extensiontypes: tp_richcompare <--> tp_hash

2006-02-01 Thread Uwe Hoffmann
ype->tp_flags & base->tp_flags & Py_TPFLAGS_HAVE_RICHCOMPARE) { if (type->tp_compare == NULL && type->tp_richcompare == NULL && type->tp_hash == NULL) { type-&