On 13/02/13 19:52, Larry Hastings wrote:
I've always hated the "".join(array) idiom for "fast" string concatenation --it's ugly and it flies in the face of TOOWTDI. I think everyone should use "x = a + b + c + d" for string concatenation, and we should just make that fast.
"".join(array) is much nicer looking than:
# ridiculous and impractical for more than a few items array + array + array + ... + array[N]
# not an expression result = "" for s in array: result += s
# currently prohibited, and not obvious sum(array, "")
although I will admit to a certain fondness towards
# even less obvious than sum map(operator.add, array)
and join has been the obvious way to do repeated concatenation of many substrings since at least Python 1.5 when it was spelled "string.join(array [, sep=" "]).