There is a more general question here: In what situation should the built-in operator
module be used in python?
The top answer claims that operator.itemgetter(x)
is "neater" than, presumably, than lambda a: a[x]
. I feel the opposite is true.
Are there any other benefits, like performance?
See Question&Answers more detail:os