Stringbuffer

Joshua Marshall jmarshal at mathworks.com
Sat Feb 3 21:36:55 EST 2001


I'm plucking characters off a stream and concatenating them.
Currently, I'm doing something like:

   buf = []
   while stream.more():
      buf = buf + stream.read()
   string.join(buf, '')

Is there a faster way?  I'm thinking of writing a Stringbuffer
class in C.  Or does a quick, reliable one already exist?



More information about the Python-list mailing list