[Python-3000] characters data type
Josiah Carlson
jcarlson at uci.edu
Wed May 3 07:10:01 CEST 2006
"Guido van Rossum" <guido at python.org> wrote:
> Better ways to do this might be [c]StringIO (in theory -- I don't know
> if it's fast enough in practice, but this should be easy to test) or
> the standard "".join(<list of strings>) approach (which underlies
> StringIO's implementation as well -- though not cStringIO's IIRC).
This is one of the reasons why I'm pushing for some string methods on
the bytes object. Even if bytes resize themselves quickly during
'extension', a single allocation with a single pass copy will be far
faster. It probably won't be quite as convenient as "".join() (if there
isn't a literal), but keeping the .join method seems to be a winner (if
only because it saves people from having to learn a different method for
unicode and bytes).
- Josiah
More information about the Python-3000
mailing list