pytholite/transel: use python3-compatible comparison methods
authorSebastien Bourdeauducq <sebastien@milkymist.org>
Sat, 17 Nov 2012 22:16:07 +0000 (23:16 +0100)
committerSebastien Bourdeauducq <sebastien@milkymist.org>
Sat, 17 Nov 2012 22:16:07 +0000 (23:16 +0100)
migen/pytholite/transel.py

index ef172a759782fd32ed0dbc27403f28eb06de380f..d46b1998d8c42d6aea7fa753b1c91cbac68827e7 100644 (file)
@@ -156,8 +156,23 @@ class Register:
        def __index__(self):
                return int(self._val)
 
-       def __cmp__(self, other):
-               return cmp(self._val, other)
+       def __lt__(self, other):
+               return self._val < other
+
+       def __le__(self, other):
+               return self._val <= other
+
+       def __eq__(self, other):
+               return self._val == other
+
+       def __ge__(self, other):
+               return self._val >= other
+
+       def __gt__(self, other):
+               return self._val > other
+
+       def __ne__(self, other):
+               return self._val != other
 
        def __str__(self):
                return str(self._val)