> hmm. consider the following: > > space = " " > foo = L"foo" > bar = L"bar" > result = space.join((foo, bar)) > > what should happen if you run this: > > a) Python raises an exception > b) result is an ordinary string object > c) result is a unicode string object Well, we could take this to the extreme, and allow _every_ object to grow a join method, where join attempts to cooerce to the same type. Thus: " ".join([L"foo", L"bar"]) -> "foo bar" L" ".join(["foo", "bar"]) -> L"foo bar" " ".join([1,2]) -> "1 2" 0.join(['1',2']) -> 102 [].join([...]) # exercise for the reader ;-) etc. Mark.
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