Hacker News new | past | comments | ask | show | jobs | submit login

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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: