Lines Matching refs:itemgetter
376 f = operator.itemgetter(2)
381 f = operator.itemgetter(10)
387 self.assertRaises(SyntaxError, operator.itemgetter(42), C())
389 f = operator.itemgetter('name')
391 self.assertRaises(TypeError, operator.itemgetter)
394 f = operator.itemgetter('key')
396 f = operator.itemgetter('nonkey')
401 getcount = operator.itemgetter(1)
408 self.assertEqual(operator.itemgetter(2,10,5)(data), ('2', '10', '5'))
409 self.assertRaises(TypeError, operator.itemgetter(2, 'x', 5), data)
413 self.assertEqual(operator.itemgetter(-1)(t), 'e')
414 self.assertEqual(operator.itemgetter(slice(2, 4))(t), ('c', 'd'))
420 self.assertEqual(operator.itemgetter(0)(T('abc')), 'a')
421 self.assertEqual(operator.itemgetter(0)(['a', 'b', 'c']), 'a')
422 self.assertEqual(operator.itemgetter(0)(range(100, 200)), 100)
563 itemgetter = self.module.itemgetter
567 f = itemgetter(2)
572 f = itemgetter(2, 0, 4)