Ejemplo n.º 1
0
 def __next__(self):
     try:
         self.rotate_current()
     except:
         try:
             self.next_chain()
         except:
             self.reset()
             next(self)
             raise StopIteration
     return pfi(self)
Ejemplo n.º 2
0
 def next_chain(self):
     self.clear()
     try:
         chain = pfi(next(self.chains))
         for link in chain:
             if type(link) == Scalar:
                 self.append(str(link))
             else:
                 sum = generator(link)
                 self.append(sum)
                 next(sum)
         else:
             pass
     except BaseException as e:
         raise StopIteration
Ejemplo n.º 3
0
 def getiter(self):
     return pfi(self, Sum)
Ejemplo n.º 4
0
 def __init__(self, iterable):
     self.chains = pfi(iterable if type(iterable) ==
                       Sum else Sum([iterable]))
     self.baseState = self.chains.getState()
     self = []
Ejemplo n.º 5
0
 def getiter(self):
     return pfi(self, Chain)