mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-10 05:47:09 +01:00
Merge pull request #599 from RobinD42/fix-issue595
Fix comparing DataViewItem with None
This commit is contained in:
@@ -84,8 +84,10 @@ def run():
|
||||
c.addCppMethod('long', '__hash__', '()', """\
|
||||
return (long)self->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', '__eq__', '(wxDataViewItem* other)',
|
||||
"return other ? (self->GetID() == other->GetID()) : false;")
|
||||
c.addCppMethod('bool', '__ne__', '(wxDataViewItem* other)',
|
||||
"return other ? (self->GetID() != other->GetID()) : true;")
|
||||
c.addAutoProperties()
|
||||
|
||||
|
||||
|
||||
@@ -54,6 +54,11 @@ class dataview_Tests(wtc.WidgetTestCase):
|
||||
self.assertTrue(int(dvi.GetID()) == n)
|
||||
|
||||
|
||||
def test_dataviewItem8(self):
|
||||
dvi = dv.DataViewItem(111)
|
||||
assert (None == dvi) == False
|
||||
assert (None != dvi) == True
|
||||
|
||||
|
||||
#-------------------------------------------------------
|
||||
def test_dataviewItemAttr1(self):
|
||||
|
||||
Reference in New Issue
Block a user