Guido wrote: > Note that this is not as powerful as string.join(); the latter works > on any sequence, not just on lists and tuples. (Though that may not > be a big deal.) > > I also find it slightly objectionable that this is a general list > method but only works if the list contains only strings; Dave Ascher's > generalization to reduce() is cute but strikes me are more general > than useful, and the name will forever present a mystery to most > newcomers. > > Perhaps join() ought to be a built-in function? come to think of it, the last design I came up with (inspired by a mail from you which I cannot find right now), was this: def join(sequence, sep=None): # built-in if not sequence: return "" sequence[0].__join__(sequence, sep) string.join => join and __join__ methods in the unicode and string classes. Guido? </F>
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4