(items)
return operator.itemgetter(*items)
Fixes itemgetter inconsistency (useful in some cases) of not returning
    a tuple if len(items) == 1: always returns an n-tuple where n = len(items)
Fixes itemgetter inconsistency (useful in some cases) of not returning
    a tuple if len(items) == 1: always returns an n-tuple where n = len(items)
Fixes itemgetter inconsistency ( useful in some cases ) of not returning a tuple if len ( items ) == 1 : always returns an n - tuple where n = len ( items )
def itemgetter_tuple(items):
    """ Fixes itemgetter inconsistency (useful in some cases) of not returning
    a tuple if len(items) == 1: always returns an n-tuple where n = len(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 )