19-08-2009 o 00:24:20 markscottwright <markscottwri...@gmail.com> wrote:

What's the correct way to turn an iterator over bytes into a string?
This works, but, ewww:
    In [8]: "".join(iter("four score and seven years ago"))
    Out[8]: 'four score and seven years ago'

But it is the correct way (and even recommended over s=s+t or s+=t, when
applicable
-- see: http://docs.python.org/library/stdtypes.html#sequence-types-str-unicode-list-tuple-buffer-xrange).

Cheers,
*j

--
Jan Kaliszewski (zuo) <z...@chopin.edu.pl>
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to