Many developers avoid using generators in regular python code. For example, many well-known python libraries uses 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.
__________________________________________________
Why developers can avoid to use the generators:
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 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…
https://2023.pycon.it/en/event/what-a...
PyCon Italia 2023, May 27, Saturday, 12:35 Room "Pizza".