On Tue, 17 Jul 2012 06:34:14 +0300 Eli Bendersky <eliben at gmail.com> wrote: > > Is there any reason for this to be so? What does BytesIO give us that the > second approach does not (I tried adding more methods to the patched > RawIOBase to make it more functional, like seekable() and tell(), and it > doesn't affect performance)? Well, try implementing non-trivial methods such as readline() or seek(), and writing in the middle rather than at the end. As Nick said, we could implement the same optimization as in StringIO, i.e. only materialize the buffer when necessary. Regards Antoine. -- Software development and contracting: http://pro.pitrou.net
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4