[issue1677872] Efficient reverse line iterator

Antoine Pitrou report at bugs.python.org
Sun Sep 5 15:58:09 CEST 2010

Antoine Pitrou <pitrou at free.fr> added the comment:


- do it on BufferedReader, rather than TextIOWrapper: if you want full-speed scanning of log files, you probably want to open them in binary mode

- rather than implementing a full-blown iterator, you can start with simple primitives: e.g. a method called readprevline() (or even scan_back() if you want to make the stop character(s) configurable)


Python tracker <report at bugs.python.org>

More information about the Python-bugs-list mailing list