def test_chain_connections(): l = [1, 2, 3] val = chain(l) first = next(val) second = next(val) assert_equals(first[1], second[0])
def test_chain_groups_2_items(): l = [1, 2] val = list(chain(l)) assert_equals(len(val), 1)
def split(self, count=2): points = self.as_points(count + 1) for p1, p2 in chain(points): yield Line(p1, p2)