1.1 --- a/lib/__builtins__/str.py Thu Dec 01 19:09:28 2016 +0100
1.2 +++ b/lib/__builtins__/str.py Thu Dec 01 19:48:31 2016 +0100
1.3 @@ -20,9 +20,10 @@
1.4 """
1.5
1.6 from __builtins__.operator import _binary_op, _negate
1.7 +from __builtins__.sequence import itemaccess
1.8 import native
1.9
1.10 -class basestring:
1.11 +class basestring(itemaccess):
1.12
1.13 "The base class for all strings."
1.14
1.15 @@ -121,6 +122,15 @@
1.16 def strip(self, chars=None): pass
1.17 def upper(self): pass
1.18
1.19 + # Special implementation methods.
1.20 +
1.21 + def __get_single_item__(self, index):
1.22 +
1.23 + "Return the item at the normalised (positive) 'index'."
1.24 +
1.25 + self._check_index(index)
1.26 + return native._str_substr(self, index, 1)
1.27 +
1.28 class string(basestring):
1.29 pass
1.30