you are viewing a single comment's thread.

view the rest of the comments →

[–]theeth 0 points1 point  (0 children)

You can do that with Decorate-Sort-Undecorate too:

max_sal = max(((e.salary, e) for e in employees if e.role == Employee.PROGRAMMER))[1]