[gedit-plugins/wip/python3: 4/19] Implement __lt__ instead of __cmp__
- From: Ignacio Casal Quinteiro <icq src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit-plugins/wip/python3: 4/19] Implement __lt__ instead of __cmp__
- Date: Fri, 9 Nov 2012 22:21:46 +0000 (UTC)
commit c239cb5899407fe5f329427c797e176766da0a89
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]