Fix __eq__ and __ne__ for comparing TreeListItem with None

This commit is contained in:
Robin Dunn
2017-11-17 14:45:01 -08:00
parent dadccaedb6
commit 4012e27c14

View File

@@ -51,9 +51,10 @@ def run():
return (long)self->GetID();
""")
c.addCppMethod('bool', '__eq__', '(wxTreeListItem* other)', "return (self->GetID() == other->GetID());")
c.addCppMethod('bool', '__ne__', '(wxTreeListItem* other)', "return (self->GetID() != other->GetID());")
c.addCppMethod('bool', '__eq__', '(wxTreeListItem* other)',
"return other ? (self->GetID() == other->GetID()) : false;")
c.addCppMethod('bool', '__ne__', '(wxTreeListItem* other)',
"return other ? (self->GetID() != other->GetID()) : true;")
#-----------------------------------------------------------------
c = module.find('wxTreeListItemComparator')