[gedit-plugins/wip/python3] Implement __lt__ instead of __cmp__



commit 1f23391a3b76948a4076a17249a69888ef0397df
Author: Ignacio Casal Quinteiro <icq gnome org>
Date:   Tue Nov 6 19:21:25 2012 +0100

    Implement __lt__ instead of __cmp__

 plugins/commander/commander/commands/method.py |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/plugins/commander/commander/commands/method.py b/plugins/commander/commander/commands/method.py
index 42acf52..618b835 100644
--- a/plugins/commander/commander/commands/method.py
+++ b/plugins/commander/commander/commands/method.py
@@ -118,10 +118,10 @@ class Method:
 
         return self.method(*args, **kwargs)
 
-    def __cmp__(self, other):
+    def __lt__(self, other):
         if isinstance(other, Method):
-            return cmp(self.name, other.name)
+            return (self.name > other.name) - (self.name < other.name)
         else:
-            return cmp(self.name, other)
+            return (self.name > other) - (self.name < other)
 
 # vi:ex:ts=4:et



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]