Differences between revisions 1 and 2
Revision 1 as of 2008-05-11 18:39:36
Size: 1021
Editor: GlennTarbox
Revision 2 as of 2008-06-27 16:51:11
Size: 1109
Editor: GlennTarbox
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


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)