Ejemplo n.º 1
0
 def __iter__(self):
     return chain.from_iterable(self.sequences)
Ejemplo n.º 2
0
 def __reversed__(self):
     return chain.from_iterable(reversed(map(reversed, self.sequences)))
Ejemplo n.º 3
0
 def __reversed__(self):
     return chain.from_iterable(reversed(map(reversed, self.sequences)))
Ejemplo n.º 4
0
 def union(self, *others):
     return self.__class__(chain.from_iterable((self, ) + others))
Ejemplo n.º 5
0
 def union(self, *others):
     return self.__class__(chain.from_iterable((self, ) + others))
Ejemplo n.º 6
0
 def __iter__(self):
     return chain.from_iterable(self.sequences)
Ejemplo n.º 7
0
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]
Ejemplo n.º 8
0
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]
Ejemplo n.º 9
0
 def __iter__(self):
     return unique(chain.from_iterable(d.iterkeys() for d in self.dicts))
Ejemplo n.º 10
0
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]
Ejemplo n.º 11
0
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]