from functools import reduce


def achain(obj, *attrs):
    """
    Gets through a chain of attributes
    handling AttributeError with None value.
    """
    def get_attr(obj, attr):
        return getattr(obj, attr, None)

    return reduce(get_attr, attrs, obj)