Big time WTF with generators - bug?
Paul Rubin
http
Wed Feb 13 04:10:21 EST 2008
James Stroud <jstroud at mbi.ucla.edu> writes:
> I can see I didn't explain so well. This one must be a bug if my code
> looks good to you.
I didn't spot any obvious errors, but I didn't look closely enough
to say that the code looked good or bad.
> Conclusion: something consumes my generator going from inside the loop
> to outside.
I'm not so sure of this, the thing is you're building these internal
grouper objects that don't expect to be consumed in the wrong order, etc.
Really, I'd try making a test iterator that prints something every
time you advance it, then step through your function with a debugger.
More information about the Python-list
mailing list