Marc> Ok, here's a more readable and semantically useful definition: ... >>> join((1,2,3)) 6 My point was that the verb "join" doesn't connote "sum". The idea of "join"ing a sequence suggests (to me) that the individual sequence elements are still identifiable in the result, so "join((1,2,3))" would look something like "123" or "1 2 3" or "10203", not "6". It's not a huge deal to me, but I think it mildly violates the principle of least surprise when you try to apply it to sequences of non-strings. To extend this into the absurd, what should the following code display? class Spam: pass eggs = Spam() bacon = Spam() toast = Spam() print join((eggs,bacon,toast)) If a join builtin is supposed to be applicable to all types, we need to decide what the semantics are going to be for all types. Maybe all that needs to happen is that you stringify any non-string elements before applying the + operator (just one possibility among many, not necessarily one I recommend). If you want to limit join's inputs to (or only make it semantically meaningful for) sequences of strings, then it should probably not be a builtin, no matter how visually annoying you find " ".join(["a","b","c"]) Skip
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