def test_tuple_equal(): yield ok, tuple_equal((1, ), (1, )) yield ok, tuple_equal((1, [1]), (1, [1])) yield ok, not tuple_equal((1, ), ([1], )) yield ok, not tuple_equal(([1], ), ([1], [1])) yield ok, tuple_equal(([1], ), ([1], )) yield ok, not tuple_equal(([1], ), ([2], )) yield ok, not tuple_equal(([1], [1, 2]), ([1, 2], [1, 2])) yield ok, not tuple_equal(([1], [1, 2]), ([1], [1, 3]))
def test_tuple_equal(): assert tuple_equal((1, ), (1, )) assert tuple_equal((1, [1]), (1, [1])) assert not tuple_equal((1, ), ([1], )) assert not tuple_equal(([1], ), ([1], [1])) assert tuple_equal(([1], ), ([1], )) assert not tuple_equal(([1], ), ([2], )) assert not tuple_equal(([1], [1, 2]), ([1, 2], [1, 2])) assert not tuple_equal(([1], [1, 2]), ([1], [1, 3]))
def __eq__(self, other): return self[0] == other[0] and \ tuple_equal(expand(self.fs), expand(other.fs))
def __eq__(self, other): return tuple_equal(expand(self.fs), expand(other.fs))