## page was renamed from GlennTarbox/TwistedTalk/125 Generators - Illusion of Blocking ## Please edit system and help pages ONLY in the moinmaster wiki! For more ## information, please see MoinMaster:MoinPagesEditorGroup. ##master-page:SlideTemplate ##master-date:Unknown-Date #format wiki #language en #pragma section-numbers off <> = 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 ##[[Navigation(siblings)]]