> On Fri, 11 Jun 1999, Skip Montanaro wrote: > > > It occurred to me just a few minutes after sending my previous message that > > it might make sense to make string.join a method for lists and tuples. > > They'd obviously have to make the same type checks that string.join does. > > as in: > > >>> ['spam!', 'eggs!'].join() > 'spam! eggs!' 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? --Guido van Rossum (home page: http://www.python.org/~guido/)
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