Re:Efficient String Concatenation in Python
by rabidsnail on Sunday December 18, 2011 @03:21PM
(#3367381)
The latter will allocate all of the integers and then free them as they're joined. The former will allocate one integer, then add it to the string and free it, then allocate another integer.
is better than
return ''.join([`num` for num in xrange(loop_count)])