Differences between revisions 2 and 3
Revision 2 as of 2008-06-27 16:51:11
Size: 1109
Editor: GlennTarbox
Comment:
Revision 3 as of 2008-11-14 13:41:55
Size: 1109
Editor: anonymous
Comment: converted to 1.6 markup
Deletions are marked like this. Additions are marked like this.
Line 9: Line 9:
[[Navigation(slides)]] <<Navigation(slides)>>

Generators - Maintaining Local Frame State

The Python literature mostly discusses generators in the context of iterators. This masks the subtle truth:

  • Generators are objects which maintain the local frame
    • These are not coroutines as there is no true stack frame maintained
    • But, you can invoke other generators from a generator getting you closer to where you might want to get
    • Python Extensions such as “Greenlets” support true coroutines

  • Twisted supports callbacks to “yield” using the “send” operator through the “inlineCallback” mechanism

    • Twisted folks view this as syntatic sugar. That Tarbox guy thinks they're a bigger deal

DsageNg/TwistedTalk/125_Generators_-_Illusion_of_Blocking (last edited 2008-11-14 13:41:55 by anonymous)