by rhettinger · 16y ago · 0 comments
Since the code is confined to a single generator, it's not easy to factor-out the steps into subroutines. PEP 380 provides a syntax for having sub-generators which can potentially be used to factor your code into smaller, reusable components.
PEP 380 is about providing better support for nested generators including the scaffolding with try/finally, g.send(), g.next(), g.throw(), and g.close().
In short, PEP 380 lets you nest, and nesting lets you factor your code.
No comments yet.