Thursday 23 March 2023

Python Generators - using yields and generators

Python generators were something that alluded me for quite a while. A spooky concept that didn't seem necessary. However after using Coroutines in C#, it sort of became a little more clear. 

Then, recently I stumbled across an excellent blog post explaining what generators do, how and when to use them:

https://github.com/qingkaikong/blog-1/blob/f453d320c06ac5b1a8d43380f9e6f9d9cf8c3022/content/2013-04-07-improve-your-python-yield-and-generators-explained.md

Check it out!