Asserts that o1 and o2 are distinct, yet equivalent objects of the same type

def assert_type_equivalent(o1, o2):
    '''Asserts that o1 and o2 are distinct, yet equivalent objects of the same type
    '''
    assert o1 == o2
    assert o2 == o1
    assert type(o1) is type(o2)