def should_exclude(type_or_instance, exclusion_list):
    """
    Tests whether an object should be simply returned when being wrapped

    """
    if type_or_instance in exclusion_list: # Check class definition
        return True
    if type(type_or_instance) in exclusion_list: # Check instance type
        return True
    try:
        if type_or_instance.__class__ in exclusion_list: # Check instance class
            return True
    except:
        pass

    return False
Tests whether an object should be simply returned when being wrapped