#attrgetter

python之attrgetter函数对对象排序

1#使用attrgetter函数对对象排序3#attrgetter处理对象,itemgetter处理序列45fromoperatorimportattrgetter678classuser():9def__init__(self,name,age):10self.name=name11self.age=age1213d...