1.1 --- a/lib/__builtins__/str.py Sat Jan 28 13:27:31 2017 +0100
1.2 +++ b/lib/__builtins__/str.py Sat Jan 28 22:37:41 2017 +0100
1.3 @@ -3,7 +3,7 @@
1.4 """
1.5 String objects.
1.6
1.7 -Copyright (C) 2015, 2016 Paul Boddie <paul@boddie.org.uk>
1.8 +Copyright (C) 2015, 2016, 2017 Paul Boddie <paul@boddie.org.uk>
1.9
1.10 This program is free software; you can redistribute it and/or modify it under
1.11 the terms of the GNU General Public License as published by the Free Software
1.12 @@ -102,8 +102,20 @@
1.13
1.14 return self._binary_op_rev(str_add, other)
1.15
1.16 - def __mul__(self, other): pass
1.17 - def __rmul__(self, other): pass
1.18 + def __mul__(self, other):
1.19 +
1.20 + "Multiply the string by 'other'."
1.21 +
1.22 + b = buffer()
1.23 +
1.24 + while other > 0:
1.25 + b.append(self)
1.26 + other -= 1
1.27 +
1.28 + return str(b)
1.29 +
1.30 + __rmul__ = __mul__
1.31 +
1.32 def __mod__(self, other): pass
1.33 def __rmod__(self, other): pass
1.34