On Mon, 10 Jul 2006 15:23:36 +0100, Sion Arrowsmith wrote: > Steven D'Aprano <[EMAIL PROTECTED]> wrote: >>Of course, another right way would be to have mutable strings in Python. > > What significant advantage would mutable strings have over StringIO > and wrapping list manipulation in list(s) and ''.join(l). Other than > that pleasing symmetry with sets/frozensets etc.
Some algorithms (e.g. genetic algorithms) have natural implementations in terms of mutable strings. StringIO is more like a kind of file than a kind of string. It has no methods for upper/lowercase, searching, etc. While files do have random access, they don't have random access insertion and deletion like lists or hypothetical mutable strings, so StringIO is no replacement at all. -- Steven. -- http://mail.python.org/mailman/listinfo/python-list