Hacker News new | ask | show | jobs
by aleksiy123 1506 days ago
I'm fairly sure `open` is a generator and doesn't load the whole file into memory. So you wouldn't hit a memory error unless like you said the amount of unique words is high enough.
1 comments

I think you're right but I believe that wrapping it in List(...) is where that would force the whole file into memory.
Yeah, you're right, that's my mistake.

I think you can just omit it but yeah...