Skip to content
This repository was archived by the owner on Jun 20, 2024. It is now read-only.

Commit 3fcdb47

Browse files
Add __lt__ and __gt__ for Python 3 comparisons. Fixes #81
1 parent 0556b61 commit 3fcdb47

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

virtualbox/library_base.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,15 @@ def __repr__(self):
7777

7878
def __eq__(self, k):
7979
return self.__cmp__(k) == 0
80+
81+
def __ne__(self, k):
82+
return self.__cmp__(k) != 0
83+
84+
def __lt__(self, k):
85+
return int(self) < int(k)
86+
87+
def __gt__(self, k):
88+
return int(self) > int(k)
8089

8190
def __cmp__(self, k):
8291
return (int(self) > int(k)) - (int(self) < int(k))

0 commit comments

Comments
 (0)