Differences between revisions 1 and 3 (spanning 2 versions)
Revision 1 as of 2008-05-11 18:39:36
Size: 1021
Editor: GlennTarbox
Comment:
Revision 3 as of 2008-11-14 13:41:55
Size: 1109
Editor: localhost
Comment: converted to 1.6 markup
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
## page was renamed from GlennTarbox/TwistedTalk/125 Generators - Illusion of Blocking
Line 8: 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 localhost)