
How to use Python’s min() and max() with nested lists - dbader
https://dbader.org/blog/python-min-max-and-nested-lists
======
littlehelper
If you're gonna re-invent the wheel, something like this is a lot more
readable in my eyes.

    
    
        def my_max(sequence, key=None):
            if not key:
                return max(sequence)
            return max(key(x) for x in sequence)
    

Combining it with the operator module that makes it a lot nicer than the
lambdas for extracting an item.

    
    
        import operator
        print(my_max([('a', 3), ('b', 2), ('c', 1)], operator.itemgetter(1)))

