the operator module also defines the following functions that create wrappers around attribute accessitem lookupand method calls attrgetter(name [name [[namen]]]creates callable objectfwhere call to (objreturns obj name if more than one argument is givena tuple of results is returned for exampleattrgetter('name','shares'returns (obj nameobj shareswhen called name can also include additional dot lookups for exampleif name is "address hostname"then (objreturns obj address hostname itemgetter(item [item [[itemn]]]creates callable objectfwhere call to (objreturns obj[itemif more than one item is given as argumentsa call to (objreturns tuple containing (obj[item]obj[item ]obj[itemn]methodcaller(name [*args [**kwargs]]creates callable objectfwhere call to (objreturns obj name(*args**kwargsthese functions are also useful for optimizing the performance of operations involving callback functionespecially those involving common data processing operations such as sorting for exampleif you wanted to sort list of tuples rows on column you could either use sorted(rowskey=lambda rr[ ]or use sorted(rowskey=itemgetter( )the second version runs much faster because it avoids the overhead associated with lambda lib fl ff