[Python-ideas] [...].join(sep)

anatoly techtonik techtonik at gmail.com
Sat May 12 10:21:17 CEST 2012


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?



More information about the Python-ideas mailing list