GNOME Bugzilla – Bug 637615
Unable to compare Gtk.TreePath with None
Last modified: 2010-12-20 16:53:50 UTC
The following fails: if path != None: pass Due to the override in Gtk.py:921 which directly calls tree_path_compare which doesn't accept None. Check for none should be added (similar
Created attachment 176728 [details] [review] Allow comparing Gtk.TreePath to None
Comment on attachment 176728 [details] [review] Allow comparing Gtk.TreePath to None Don't we need this for the other richcompare functions? You might never do if tree_path > None: but you might do a = None if tree_path > a: I'm not sure if that should error out or always return True. Also can you add a test to tests/test_overrides.py?
Created attachment 176734 [details] [review] Allow comparing Gtk.TreePath to None
At first I wasn't sure whether the others made any logical sense to not error out, but after checking pythons behavior for other objects, I implemented them accordingly. See attached patch (also includes tests).
Attachment 176734 [details] pushed as 78ea84c - Allow comparing Gtk.TreePath to None