Comment

jfs

It might be more efficient to count bytes by reading chunks instead of lines: `_count_file_object = lambda file: sum(map(len, iter(lambda: file.read(1<<15), b'')))` (assuming you don't want `os.path.getsize(filename)` or similar). Related: https://stackoverflow.com/questions/9371238/why-is-reading-lines-from-stdin-much-slower-in-c-than-python