4 ms·
Ah, you're absolutely right. for line in open(filename) returns a generator. I added map(str.upper, xxx) there to make it more it make sense. But the point sho
by exDM69 12y ago
Ah, you're absolutely right. for line in open(filename) returns a generator. I added map(str.upper, xxx) there to make it more it make sense.
But the point should be obvious, without generators that would potentially consume a lot of memory.