Index ¦ Archives ¦ Atom > Tag: python

Don't Convert Generators to List at Once

TL;DR: Convert the generator into list, if and only if the dataset is small, else consume on demand or rethink your design.

Python has a special function called Generators which yields value as we request from it rather than dumping everything into the memory at once. For example think …

© Prasanna Venkadesh. Creative Commons Attribution ShareAlike. Theme by Giulio Fidente on github.