Iterators for Curious Minds

My talk given at PyCon CZ 2019.

Abstract

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.

Video

Videos from PyCon CZ 2019 are unfortunately no longer available.

Slides from the presentation

PDF version

Iterators for Curious Minds - Slide 1 Iterators for Curious Minds - Slide 2 Iterators for Curious Minds - Slide 3 Iterators for Curious Minds - Slide 4 Iterators for Curious Minds - Slide 5 Iterators for Curious Minds - Slide 6 Iterators for Curious Minds - Slide 7 Iterators for Curious Minds - Slide 8 Iterators for Curious Minds - Slide 9 Iterators for Curious Minds - Slide 10 Iterators for Curious Minds - Slide 11 Iterators for Curious Minds - Slide 12 Iterators for Curious Minds - Slide 13 Iterators for Curious Minds - Slide 14 Iterators for Curious Minds - Slide 15 Iterators for Curious Minds - Slide 16 Iterators for Curious Minds - Slide 17 Iterators for Curious Minds - Slide 18 Iterators for Curious Minds - Slide 19 Iterators for Curious Minds - Slide 20 Iterators for Curious Minds - Slide 21 Iterators for Curious Minds - Slide 22 Iterators for Curious Minds - Slide 23 Iterators for Curious Minds - Slide 24 Iterators for Curious Minds - Slide 25 Iterators for Curious Minds - Slide 26 Iterators for Curious Minds - Slide 27 Iterators for Curious Minds - Slide 28 Iterators for Curious Minds - Slide 29 Iterators for Curious Minds - Slide 30 Iterators for Curious Minds - Slide 31 Iterators for Curious Minds - Slide 32 Iterators for Curious Minds - Slide 33 Iterators for Curious Minds - Slide 34 Iterators for Curious Minds - Slide 35 Iterators for Curious Minds - Slide 36 Iterators for Curious Minds - Slide 37 Iterators for Curious Minds - Slide 38 Iterators for Curious Minds - Slide 39 Iterators for Curious Minds - Slide 40 Iterators for Curious Minds - Slide 41 Iterators for Curious Minds - Slide 42 Iterators for Curious Minds - Slide 43 Iterators for Curious Minds - Slide 44 Iterators for Curious Minds - Slide 45 Iterators for Curious Minds - Slide 46 Iterators for Curious Minds - Slide 47 Iterators for Curious Minds - Slide 48

License

Slides are licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Creative Commons License