Thursday 9 a.m.–12:20 p.m.
Generators: The Final Frontier
David Beazley
- Audience level:
- Experienced
- Category:
- Python Core (language, stdlib, etc.)
Description
Abstract
Generators: The Final Frontier
This tutorial explores advanced uses of generators and coroutines for customizing various aspects of program control-flow. The tutorial will involve looking, in detail, at a series of interesting examples which include the following:
Defining new context managers (@contextmanager decorator)
Inlining callback functions (e.g., understanding tricks underlying features such as the inlineCallbacks decorator in Twisted).
Yieldable threads (side-stepping the GIL).
Implementing simple actors (communicating tasks).
Using generators to eliminate recursion (avoiding the interpreter recursion limit).
Although the main focus of the tutorial is on generators, attendees will gain a lot of insight into the inner workings and design of the above topics and how they related to advanced libraries and frameworks.
Student Handout
No handouts have been provided yet for this tutorial