Big time WTF with generators - bug?

Paul Rubin http
Wed Feb 13 12:03:02 CET 2008

James Stroud <jstroud at> writes:
> Brilliant suggestion. Worked like a charm. Here is the final product:

Cool, glad it worked out.  When writing this type of code I like to
use doctest to spell out some solid examples of what each function is
supposed to do, as part of the function.  It's the only way I can
remember the shapes of the sequences going in and out, and the
automatic testing doesn't hurt either.  Even with that though, at
least for me, Python starts feeling really scary when the iterators
get this complicated.  I start wishing for a static type system,
re-usable iterators, etc.

More information about the Python-list mailing list