• Christopher Pitt


In the previous chapter, we learned about generators: how they work, and one or two things they can be useful for. We ended with a demonstration of building a multitasking system. In particular, we looked at how to use generators as interruptible functions. Other programming languages call this kind of function a coroutine (short for cooperative routine), because it cooperates to allow for multitasking.

Copyright information

© Christopher Pitt 2018

Authors and Affiliations

  • Christopher Pitt
    • 1
  1. 1.Cape TownSouth Africa

Personalised recommendations