[$] Reworking StringIO concatenation in Python
Python string objects are immutable, so changing the value of a stringrequires that a new string object be created with the new value. That isfairly well-understood within the community, but there are some"anti-patterns" that arise; it is pretty common for new users to build up alonger string by repeatedly concatenating to the end of the "same" string.The performance penalty for doing that could be avoided by switching to atype that is geared toward incremental updates, but Python 3 hasalready optimized the penalty away for regular strings. A recent thread on the python-ideasmailing list explored this topic some.