Iterators for Curious Minds
My talk given at PyCon CZ 2019.
Do you know the difference between iterators and iterables? Are you able to implement a custom collection? Why something so basic as a for-loop got its chapter in the famous Gang of Four book?
The iterator protocol is a prime example of Python language design.
I will not only show how to implement custom iterators but also illustrate how other Python features are provided using similar idioms. I will informally introduce the iterator design pattern and show how it is built into the language. After mentioning some examples of iterables, we will look into Python data model, implement some generators, and maybe touch async frameworks.
Videos from PyCon CZ 2019 are unfortunately no longer available.
Slides from the presentation
Slides are licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.