Description
What are generators and coroutines in Python? What additional conceptualisations do they offer, and how can we use them to better model problems? This is a talk I've given at PyData London, PyCon Spain, and the conference "for Python Quants". It's an intermediate-level talk around the core concept of generators with a lot of examples of not only neat things you can do with generators but also new ways to model and conceptualise problems.
Generators are one of the most notable features of Python, and they are a critical component of Python 3's driving focus on iterability as a core protocol. This talk introduces the basic concepts surrounding generators, generator expressions, and co-routines, then dives into ways that generators can improve our code: not just in terms of performance but also by offering us better ways to model our problems.