from functools import reduce


def map_reduce_attr(attr, elems, op, init):
    """ Execute map-reduce on instance attributes (non-callable).
    """

    return reduce(op, map(lambda elem: getattr(elem, attr), elems), init)