5 ms·
What's wrong with `''.join()`? It's fine as is, I think, same logic as '{}'.format().
by aldanor 11y ago
What's wrong with `''.join()`? It's fine as is, I think, same logic as '{}'.format().
- basketcasing 11y agoRe. join, I think Perl got that one right: `join(glue, pieces)`. `','.join(pieces)` just seems unnecessarily weird, and present simply for OO's sake. Not everything needs to be some object's method.
- aldanor 11y agoYes but then you can map things more easily without having to create partials, and it's consistent with how all other methods work in Python (e.g. format method) >>> phrases = [['a', 'b', 'c'], ['d', 'e']] >>> print(list(map('-'.join, phrases))) ['a-b-c', 'd-e']