Lines Matching refs:itemgetter
14 from operator import itemgetter, iadd
290 .. function:: itemgetter(item)
291 itemgetter(*items)
297 * After ``f = itemgetter(2)``, the call ``f(r)`` returns ``r[2]``.
299 * After ``g = itemgetter(2, 5, 3)``, the call ``g(r)`` returns
304 def itemgetter(*items):
318 >>> itemgetter('name')({'name': 'tu', 'age': 18})
320 >>> itemgetter(1)('ABCDEFG')
322 >>> itemgetter(1,3,5)('ABCDEFG')
324 >>> itemgetter(slice(2,None))('ABCDEFG')
328 >>> itemgetter('rank')(soldier)
331 Example of using :func:`itemgetter` to retrieve specific fields from a
335 >>> getcount = itemgetter(1)