[Python-ideas] Create a StringBuilder class and use it everywhere

Mike Graham mikegraham at gmail.com
Thu Aug 25 14:31:58 CEST 2011

On Thu, Aug 25, 2011 at 5:28 AM, k_bx <k.bx at ya.ru> wrote:
>    def main_bucket():
>        b = StringBuilder(u"initial value ")
>        for i in xrange(30000000):
>            b += u"more data"
>        return unicode(b)

This doesn't seem nicer to read and write to me than the list form. I
also do not see any reason to believe it will stop people from doing
it the quadratic way if the ubiquitous make-a-list-then-join idiom
does not.


More information about the Python-ideas mailing list