def function(self, *args, **kw): return united(paired(*args, **kw))
def test_other(self): self.assert_iter_equal(united(paired([0, 1])), [0, 1]) self.assert_iter_equal(united(paired(range(3))), list(range(3))) self.assert_iter_equal(united(paired(range(12))), list(range(12)))
def function(self, *args, **kw): return paired(*args, **kw)
def test_other(self): self.assert_iter_equal(paired(range(3)), [(0, 1), (1, 2)]) self.assert_iter_equal(paired(range(4)), [(0, 1), (1, 2), (2, 3)]) self.assert_iter_equal(paired(range(5)), [(0, 1), (1, 2), (2, 3), (3, 4)])
def test_empty(self): for value in [-1, None, 0, 1]: self.assert_iter_equal(chopped(paired(range(0)), value), [])
def test_values(self): for value in [-1, 1, 10]: for input_ in [-1, None, 0]: self.assert_iter_equal(chopped(paired(range(value)), input_), [])
def _transition_pairs(self, strings): for string in strings: yield from iterlib.paired(string)