def __iter__(self): return chain.from_iterable(self.sequences)
def __reversed__(self): return chain.from_iterable(reversed(map(reversed, self.sequences)))
def union(self, *others): return self.__class__(chain.from_iterable((self, ) + others))
def test_chain(): list(chain([1, 2], [3, 4])) == [1, 2, 3, 4] list(chain.from_iterable([[1, 2], [3, 4]])) == [1, 2, 3, 4]
def test_chain(): Assert(list(chain([1, 2], [3, 4]))) == [1, 2, 3, 4] Assert(list(chain.from_iterable([[1, 2], [3, 4]]))) == [1, 2, 3, 4]
def __iter__(self): return unique(chain.from_iterable(d.iterkeys() for d in self.dicts))