Mutable Strings - Any libraries that offer this?

casebash walkraft at
Wed Jul 22 08:59:34 CEST 2009

Thanks all for your advice. I'm not actually going to use the mutable
string right at the moment, but I thought I might in the future and I
was just curious if it existed. I suppose a list of characters is
close enough for most purposes.

On Jul 22, 10:28 am, greg <g... at> wrote:
> Ben Finney wrote:
> > My point was rather meant to imply that
> > subclassing the built-in (immutable)stringtypes was the best way to
> > usefully get all their functionality
> However, it would be difficult to do that without changing
> all C code that deals with strings, including that in extension
> modules.
> That's because the existingstringtype stores the characters
> in thestringobject itself. Amutablevariant would have to
> contain a pointer to a resizable memory block, and therefore
> couldn't be used as a drop-in replacement by existing C
> code that expects astring.
> --
> Greg

More information about the Python-list mailing list