1.1 --- a/lib/__builtins__/str.py Fri Dec 09 16:26:50 2016 +0100
1.2 +++ b/lib/__builtins__/str.py Fri Dec 09 17:27:30 2016 +0100
1.3 @@ -22,7 +22,8 @@
1.4 from __builtins__.int import maxint, minint
1.5 from __builtins__.operator import _negate
1.6 from __builtins__.sequence import itemaccess
1.7 -import native
1.8 +from native import str_add, str_lt, str_gt, str_eq, str_len, str_nonempty, \
1.9 + str_substr
1.10
1.11 class basestring(itemaccess):
1.12
1.13 @@ -68,7 +69,7 @@
1.14
1.15 "Return a string combining this string with 'other'."
1.16
1.17 - return self._binary_op(native.str_add, other)
1.18 + return self._binary_op(str_add, other)
1.19
1.20 __add__ = __radd__ = __iadd__
1.21
1.22 @@ -81,13 +82,13 @@
1.23
1.24 "Return whether this string is less than 'other'."
1.25
1.26 - return self._binary_op(native.str_lt, other)
1.27 + return self._binary_op(str_lt, other)
1.28
1.29 def __gt__(self, other):
1.30
1.31 "Return whether this string is greater than 'other'."
1.32
1.33 - return self._binary_op(native.str_gt, other)
1.34 + return self._binary_op(str_gt, other)
1.35
1.36 def __le__(self, other):
1.37
1.38 @@ -105,7 +106,7 @@
1.39
1.40 "Return whether this string is equal to 'other'."
1.41
1.42 - return self._binary_op(native.str_eq, other)
1.43 + return self._binary_op(str_eq, other)
1.44
1.45 def __ne__(self, other):
1.46
1.47 @@ -117,7 +118,7 @@
1.48
1.49 "Return the length of this string."
1.50
1.51 - return native.str_len(self.__data__)
1.52 + return str_len(self.__data__)
1.53
1.54 def __str__(self):
1.55
1.56 @@ -134,7 +135,7 @@
1.57 return str(b)
1.58
1.59 def __bool__(self):
1.60 - return native.str_nonempty(self.__data__)
1.61 + return str_nonempty(self.__data__)
1.62
1.63 def endswith(self, s): pass
1.64 def find(self, sub, start=None, end=None): pass
1.65 @@ -182,7 +183,7 @@
1.66 "Return the item at the normalised (positive) 'index'."
1.67
1.68 self._check_index(index)
1.69 - return native.str_substr(self.__data__, index, 1)
1.70 + return str_substr(self.__data__, index, 1)
1.71
1.72 class string(basestring):
1.73 pass