Re: two generators working in tandem

2006-02-12 Thread Anton Vredegoor
Michael Spencer wrote: > This returns an iterator that 'nests' an arbitrary number of sequences > (odometer-style). > > def nest(*sequences): > def _nest(outer, inner): > for outer_item in outer: > if not isinstance(outer_item, tuple): > outer_item = (o

Re: two generators working in tandem

2006-02-11 Thread Michael Spencer
john peter wrote: > I'd like to write two generators: one is a min to max sequence number > generator that > rolls over to min again once the max is reached. the other is a generator > that cycles > through N (say, 12) labels. currently, i'm using these generators in nested > loops like >

two generators working in tandem

2006-02-10 Thread john peter
I'd like to write two generators: one is a min to max sequence number generator that rolls over to min again once the max is reached. the other is a generator that cycles through N (say, 12) labels. currently, i'm using these generators in nested loops like this:   seq_numbers = genSeqNum(min,