def __init__(self, geometry): self.geometry = geometry if geometry is None: geom_form = [] else: geom_form = list(geometry.form) form = list(self.form()) + geom_form if not all_equal([type(number) for number in form]): raise TypeError
def test_all_equal(): assert all_equal([]) assert all_equal([1]) assert all_equal([1, 1, 1]) assert not all_equal([2, 1, 1, 1]) assert not all_equal([1, 2])