Changeset 921:11f9fb4fb178 for src/mlx/logger.py
- Timestamp:
- 04/27/19 12:06:32 (5 years ago)
- Branch:
- python3
- hg-Phase:
- (<MercurialRepository 1 'hg:/home/ivaradi/mlx/hg' '/'>, 'public')
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/logger.py
r919 r921 7 7 import time 8 8 import bisect 9 from functools import total_ordering 9 10 10 11 #-------------------------------------------------------------------------------------- … … 34 35 increasing IDs.""" 35 36 37 @total_ordering 36 38 class Entry(object): 37 39 """An entry in the log.""" … … 119 121 id = self._id) 120 122 121 def __cmp__(self, other): 122 """Compare two entries 123 124 First their timestamps are compared, and if those are equal, then 125 their IDs.""" 126 result = cmp(self._timestamp, other.timestamp) 127 if result==0: 128 result = cmp(self._id, other._id) 129 return result 123 def __eq__(self, other): 124 """Equality comparison""" 125 return self._timestamp == other.timestamp and \ 126 self._id == other._id 127 128 def __ne__(self, other): 129 """Non-equality comparison""" 130 return self._timestamp != other.timestamp or \ 131 self._id != other._id 132 133 def __lt__(self, other): 134 """Less-than comparison""" 135 return self._timestamp < other.timestamp or \ 136 (self._timestamp == other.timestamp and 137 self._id < other._id) 130 138 131 139 class Fault(object):
Note:
See TracChangeset
for help on using the changeset viewer.