Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
kiidev
· 5y ago · 0 comments
Isn't that going to be even slower, since a 156mb file would probably make gc_lines a very big tuple before summing it?
Comments
[–]
makapuf
5y ago
You could do gc=sum(1 for _ on lines if ...) or use Counter
[–]
henbruas
5y ago
gc_lines isn't a tuple here, it's a generator expression. It will be lazily evaluated.