Big time WTF with generators - bug?

Paul Rubin http
Wed Feb 13 06:03:02 EST 2008


James Stroud <jstroud at mbi.ucla.edu> 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