Antoine Pitrou <pit...@free.fr> added the comment:

Yes, these are things I've been wondering about. The use-case for an 
append-only StringIO is obviously overlapping with the use-case for using 
''.join(). However, the implementation I'm proposing is better than ''.join() 
when writing very small strings, since there's a periodic consolidation.

> As a special case, you may consider that .truncate(0) doesn't really
> need to realize the buffer first.

True. Also, seek(0) then read() could use the same optimization.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue13149>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to