Mutable strings in Python

Ecir Hana picture Ecir Hana · May 13, 2012 · Viewed 46.8k times · Source

Please, do you know of a Python library which provides mutable strings? Google returned surprisingly few results. The only usable library I found is http://code.google.com/p/gapbuffer/ which is in C but I would prefer it to be written in pure Python.

Edit: Thanks for the responses but I'm after an efficient library. That is, ''.join(list) might work but I was hoping for something more optimized. Also, it has to support the usual stuff regular strings do, like regex and unicode.

Answer

Jason M picture Jason M · May 13, 2012

In Python mutable sequence type is bytearray see this link