1.1 --- a/lib/__builtins__/unicode.py Tue Dec 13 22:46:52 2016 +0100
1.2 +++ b/lib/__builtins__/unicode.py Tue Dec 13 22:48:28 2016 +0100
1.3 @@ -77,6 +77,29 @@
1.4 else:
1.5 return op(other.__data__, self.__data__)
1.6
1.7 + def _convert(self, result, other):
1.8 +
1.9 + "Convert 'result' to a Unicode object if 'other' already is."
1.10 +
1.11 + if _isinstance(other, utf8string):
1.12 + return utf8string(result, self.encoding)
1.13 + else:
1.14 + return result
1.15 +
1.16 + def __iadd__(self, other):
1.17 +
1.18 + "Return a string combining this string with 'other'."
1.19 +
1.20 + return self._convert(self._binary_op(str_add, other), other)
1.21 +
1.22 + __add__ = __iadd__
1.23 +
1.24 + def __radd__(self, other):
1.25 +
1.26 + "Return a string combining this string with 'other'."
1.27 +
1.28 + return self._convert(self._binary_op_rev(str_add, other), other)
1.29 +
1.30 def encode(self, encoding=None):
1.31
1.32 """