python3 的用法是这样吗,麻烦大神帮我解释下
import operator class Student(object): def __init__(self, name, score): self.name = name self.score = score def __str__(self): return '(%s: %s)' % (self.name, self.score) __repr__ = __str__ def __lt__(self, s): if self.score == s.score: return operator.gt(self.name, s.name) return operator.gt(self.score, s.score) L = [Student('Tim', 99), Student('Bob', 88), Student('Alice', 99)] print (sorted(L))