News for hackers. Stuff that matters.
Re:Python idioms by Ysx on Sunday June 12, 2011 @02:04PM (#2646990)
Interesting! ''.join() has the advantage on longer strings though:

$ python -mtimeit "'aaaaaaaaaaaaaaa' + 'bbbbbbbbbbbbbbb' + 'ccccccccccccccc' + 'ddddddddddddddd'"

1000000 loops, best of 3: 0.224 usec per loop

$ python -mtimeit "''.join(('aaaaaaaaaaaaaaa','bbbbbbbbbbbbbbb','ccccccccccccccc','ddddddddddddddd'))"

10000000 loops, best of 3: 0.201 usec per loop

Re:Python idioms by kqueue on Sunday June 12, 2011 @03:06PM (#2647132)
That's definitely interesting.