We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 07807e9 commit e33a116Copy full SHA for e33a116
iso639/iso639.py
@@ -168,10 +168,13 @@ def __hash__(self):
168
def __eq__(self, other):
169
return type(other) is type(self) and hash(other) == hash(self)
170
171
- def __lt__(self, other):
172
- return (
173
- type(other) is type(self) and other.name and self.name < other.name
174
- )
+ def __lt__(self, other) -> bool:
+ for i in range(min(len(self), len(other))):
+ if self[i] < other[i]:
+ return True
175
+ elif self[i] > other[i]:
176
+ return False
177
+ return len(self) < len(other)
178
179
def __getnewargs__(self):
180
unpickling_args = (self.name,)
0 commit comments