finds extra attributes in *value* if they are there

def find_extra_attrs(value):
    "finds extra attributes in *value* if they are there"
    extra = None
    value_is_from_database = True

    if hasattr(value, 'standin_value_is_from_database'):
        value_is_from_database = value.standin_value_is_from_database

        if value.stored_value != value.msg:
            extra = value.msg
        elif value.stored_value != value.fallback:
            extra = value.fallback
    
    return extra, value_is_from_database