mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-08 04:50:07 +01:00
Use rich compare methods instead of __cmp__, as Python3 doesn't support the latter.
This commit is contained in:
@@ -82,11 +82,12 @@ def run():
|
||||
c.addCppMethod('long', '__hash__', '()', """\
|
||||
return (long)self->GetID();
|
||||
""")
|
||||
c.addCppMethod('int', '__cmp__', '(wxDataViewItem* other)', """\
|
||||
if ( self->GetID() < other->GetID() ) return -1;
|
||||
if ( self->GetID() > other->GetID() ) return 1;
|
||||
return 0;
|
||||
""")
|
||||
c.addCppMethod('bool', '__lt__', '(wxDataViewItem* other)', "return (self->GetID() < other->GetID());")
|
||||
c.addCppMethod('bool', '__le__', '(wxDataViewItem* other)', "return (self->GetID() <= other->GetID());")
|
||||
c.addCppMethod('bool', '__eq__', '(wxDataViewItem* other)', "return (self->GetID() == other->GetID());")
|
||||
c.addCppMethod('bool', '__ne__', '(wxDataViewItem* other)', "return (self->GetID() != other->GetID());")
|
||||
c.addCppMethod('bool', '__ge__', '(wxDataViewItem* other)', "return (self->GetID() >= other->GetID());")
|
||||
c.addCppMethod('bool', '__gt__', '(wxDataViewItem* other)', "return (self->GetID() > other->GetID());")
|
||||
c.addAutoProperties()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user