Joining strings versus augmented assignment

Skip Montanaro skip at
Fri Jan 31 14:48:34 CET 2003

    Andy> In his Linux Journal piece on Quixote
    Andy> ( Greg Ward
    Andy> mentions that when joining a series of strings together it is more
    Andy> efficient to use "".join(listOfStrings) rather than += (augmented
    Andy> assignment).

Augmented assignment:

    s += t

amounts to nothing more than 

    s = s + t

Once that equivalence is established, you can refer to the somewhat
outdated, but still germane:

for the remaining details.


More information about the Python-list mailing list