12 May 2012 10:21
[...].join(sep)
I am certain this was proposed many times, but still - why it is rejected?
"real man don't use spaces".split().join('+').upper()
instead of
'+'.join("real man don't use spaces".split()).upper()
The class purity (not being dependent from objects of other class) is
not an argument here:
string.join() produces list, why list.join() couldn't produce strings?
The impedance mismatch can be, but it is a pain already and
string.join() doesn't help:
that means you still get exception when trying to join lists with
no strings inside
Can practicality still beat purity in this case?
RSS Feed