1.1 --- a/lib/__builtins__/str.py Wed Dec 07 17:15:12 2016 +0100
1.2 +++ b/lib/__builtins__/str.py Wed Dec 07 17:24:39 2016 +0100
1.3 @@ -139,7 +139,30 @@
1.4 def endswith(self, s): pass
1.5 def find(self, sub, start=None, end=None): pass
1.6 def index(self, sub, start=None, end=None): pass
1.7 - def join(self, l): pass
1.8 +
1.9 + def join(self, l):
1.10 +
1.11 + "Join the elements in 'l' with this string."
1.12 +
1.13 + # Empty strings just cause the list elements to be concatenated.
1.14 +
1.15 + if not self.__bool__():
1.16 + return str(buffer(l))
1.17 +
1.18 + # Non-empty strings join the elements together in a buffer.
1.19 +
1.20 + b = buffer()
1.21 + first = True
1.22 +
1.23 + for s in l:
1.24 + if first:
1.25 + first = False
1.26 + else:
1.27 + b.append(self)
1.28 + b.append(s)
1.29 +
1.30 + return str(b)
1.31 +
1.32 def lower(self): pass
1.33 def lstrip(self, chars=None): pass
1.34 def replace(self, old, new, count=None): pass