Mutable Strings - Any libraries that offer this?

John Machin sjmachin at lexicon.net
Mon Jul 20 07:30:12 EDT 2009


On Jul 20, 9:08 pm, Ben Finney <ben+pyt... at benfinney.id.au> wrote:
> casebash <walkr... at gmail.com> writes:
> > I have searched this list and found out that Python doesn't have a
> > mutable string class (it had an inefficient one, but this was removed
> > in 3.0). Are there any libraries outside the core that offer this?
>
> A mutable string would not (AFAICT) be usefully implementable as a
> subclass of the built-in string types. So even if such a type existed,
> it would not be useable with all the functionality that works with
> strings.
>
> What is it you're trying to do that makes you search for a mutable
> string type? It's likely that a better approach can be found.
>

OK, I'll bite: where does the Python 3.x bytearray type fit into your
taxonomy? At first glance it appears to be mutable and have a fair
swag of functionality.



More information about the Python-list mailing list