def build_attribute_set(items, attr_name):
    """Build a set off of a particular attribute of a list of
    objects. Adds 'None' to the set if one or more of the
    objects in items is missing the attribute specified by
    attr_name.
    """
    attribute_set = set()
    for item in items:
        attribute_set.add(getattr(item, attr_name, None))
    return attribute_set