def methodcaller(name, *args):
    """
    Upstream bug in python:
    https://bugs.python.org/issue26822
    """
    func = operator.methodcaller(name, *args)
    return lambda obj, **kwargs: func(obj)