|
|
|
|
|
by dr_kiszonka
1641 days ago
|
|
I find generators useful when working with very large data structures because generators can be pretty efficient. You can also use them to write little helper functions. Have a look at this package and its source [0]. Oh, and don't feel bad if you never have a need for generators! For the longest time I felt like a steal for rarely using classes but I am over it now :) 0. https://more-itertools.readthedocs.io/en/stable/ |
|
I haven't made use of return values from generators in my code either, but I believe they're used under the hood in coroutines in async code.