News for hackers. Stuff that matters.
Re:Efficient String Concatenation in Python by c00w on Sunday December 18, 2011 @02:50PM (#3367327)
return ''.join(`num` for num in xrange(loop_count))

is better than

return ''.join([`num` for num in xrange(loop_count)])

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.