def itemgetter_tuple(items):
 if (len(items) == 0):
  return (lambda a: ())
 if (len(items) == 1):
  return (lambda gettable: (gettable[items[0]],))
 return operator.itemgetter(*items)

def itemgetter_tuple ( items ) : if ( len ( items ) == 0 ) : return ( lambda a : ( ) ) if ( len ( items ) == 1 ) : return ( lambda gettable : ( gettable [ items [ 0 ] ] , ) ) return operator . itemgetter ( * items )
fixes itemgetter inconsistency of not returning a tuple if len == 1: always returns an n-tuple where n = len .