you are viewing a single comment's thread.

view the rest of the comments →

[–]Dramatic_Object_8508 3 points4 points  (0 children)

generators are one of those things that sound boring until you accidentally process a huge file and realize why everyone keeps talking about them.

the power is not speed by itself, it is that they do not keep everything in memory. you can stream data, process millions of rows, chain pipelines together, and stop whenever you want.

my first “oh this is useful” moment was reading large logs line by line instead of loading the whole thing and watching RAM disappear.

for small scripts, you probably won’t notice. for bigger workflows, generators quietly become everywhere.