mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
This commit is contained in:
parent
b4bbee25b1
commit
d6da90f93d
3 changed files with 17 additions and 1 deletions
|
@ -86,7 +86,11 @@ class _safe_key:
|
|||
self.obj = obj
|
||||
|
||||
def __lt__(self, other):
|
||||
rv = self.obj.__lt__(other.obj)
|
||||
try:
|
||||
rv = self.obj.__lt__(other.obj)
|
||||
except TypeError:
|
||||
rv = NotImplemented
|
||||
|
||||
if rv is NotImplemented:
|
||||
rv = (str(type(self.obj)), id(self.obj)) < \
|
||||
(str(type(other.obj)), id(other.obj))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue