Editable strings anyone?

Martin v. Loewis martin at v.loewis.de
Sun Feb 17 08:16:34 EST 2002


Paul Rubin <phr-n2002a at nightsong.com> writes:

> I'm wondering how difficult it would be to add an editable (mutable)
> string class to Python 2.2 implemented in C under the new type/class
> unification scheme.

There is already an efficient mutable vector type, the array type,
which can be used to implement both mutable byte strings and mutable
character strings.

> Java has a StringBuffer class which Java programmers use idiomatically
> whenever they want to build a big string from smaller ones.  Python
> surprisingly lacks a counterpart to StringBuffer.

The Python counterpart of the Java StringBuffer is the StringIO module.

Regards,
Martin



More information about the Python-list mailing list