Talks: Generators, coroutines, and nanoservices

Friday - April 21st, 2023 4:15 p.m.-4:45 p.m. in 255ABC

Presented by:

Experience Level:

Advance experience


Generator functions have been a part of Python for many years already, and are a well known technique for creating iterators. But generators have a few lesser-known aspects, including their “send” method and the “yield from” syntax. Many Python developers shy away from using them, unsure of what they would do, or how they would be useful — seeing coroutines as a solution looking for a problem.

In this talk, I’ll tell you why coroutines can be useful, and how thinking about them as in-process “nanoservices” puts us in the right frame of mind to determine when they would and wouldn’t be appropriate. Among the topics we’ll explore are: