Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
thiasdflkj
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
3 ms
·
1.
▲
by
thiasdflkj
6y ago
why the `fp.readline()` and `while line:` business? I don't have a big file handy to benchmark but that pattern moves the file reading into python bytecode. The canonical way to read a file line by line while counting the lines is to l