def unique_attr(seq, attr):
    """Filters out objects with a duplicate attribute value
    """
    result = []
    seen = set()
    for s in seq:
        a = getattr(s, attr)
        if a not in seen:
            seen.add(a)
            result.append(s)
    return result