3 ms·
The problem with `while line := f.readline():` is that it takes preasure of library writers. You should really just do `for line in f:`. If the library only has
by thomasahle 7y ago
The problem with `while line := f.readline():` is that it takes preasure of library writers. You should really just do `for line in f:`. If the library only has a `next` function, it needs to be fixed.
- masklinn 7y ago`f` might be iterable / iterator with completely different semantics than doing by-line iteration. And that might even be a good idea.
- thomasahle 7y agoIn this case it isn't though. And if it were, you could provide an `f.lines()` iterator. The code would be much nicer that way.