(self, inter, f, seq)
Call f on each item in seq, calling inter() in between.
Call f on each item in seq, calling inter() in between.
Call f on each item in seq calling inter () in between .
def interleave(self, inter, f, seq):
        """Call f on each item in seq, calling inter() in between."""
        seq = iter(seq)
        try:
            f(next(seq))
        except StopIteration:
            pass
        else:
            for x in seq:
                inter()
                f(x)
def interleave ( self , inter , f , seq ) : seq = iter ( seq ) try : f ( next ( seq ) ) except StopIteration : pass else : for x in seq : inter ( ) f ( x )