Many developers avoid using generators. For example, many well-known python libraries use lists instead of generators. The generators themselves are slower than normal list loops, but their use in code greatly increases the speed of the application. Let’s discover why.
Many developers, avoid to use the generators in regular python code:
It is hard to debug, it is not easy to profile, it is not obviously to refactor. it requires to use special algorithms. In this talk i speak about generator pipelines, one-line-generators, builtin-generators, custom generators with yield and yield from. I will show how to use generators and why we should use them. Also, we learn about situations where we can’t use generators and how to change our thinking to avoid such situations in the future. I give some hints and examples - how big python frameworks use lists instead of generators and therefore lose performance. At the end we can see how builtin zip function works in other world, where developers always use generators in own code.
Let see what we can yield from this talk…