I would think a more natural approach of making join a method of any sequence would result in cleaner programs.
(a, b, c).join(',')
instead of: ','.join((a, b, c))
(a, b, c).join(',')
instead of: ','.join((a, b, c))
>>> "abcbe".split("b")
['a', 'c', 'e']
So to get back the original string you should be able to say: ['a', 'c', 'e'].join("b") #!!! WRONG !!!
but this doesn't work and instead you have to say: >>> "b".join(['a', 'c', 'e'])
'abcbe'br = '<br>'.join
br((a, b, c))
Personally I think it makes more sense the ruby way but it's never bugged me.
def br(sl):
return string.join(sl, "<br>")
or br = lambda sl: string.join(sl, "<br>")
for the same effect. It's actually due to first-class functions.