[pypy-commit] pypy py3k: Fix translation (sorry)

arigo pypy.commits at gmail.com
Tue Aug 30 06:30:26 EDT 2016


Author: Armin Rigo <arigo at tunes.org>
Branch: py3k
Changeset: r86727:cc6433b66e6f
Date: 2016-08-30 12:29 +0200
http://bitbucket.org/pypy/pypy/changeset/cc6433b66e6f/

Log:	Fix translation (sorry)

diff --git a/pypy/objspace/std/bytearrayobject.py b/pypy/objspace/std/bytearrayobject.py
--- a/pypy/objspace/std/bytearrayobject.py
+++ b/pypy/objspace/std/bytearrayobject.py
@@ -441,6 +441,11 @@
     def descr_copy(self, space):
         return self._new(self.data[:])
 
+    @staticmethod
+    def _iter_getitem_result(self, space, index):
+        assert isinstance(self, W_BytearrayObject)
+        return self._getitem_result(space, index)
+
 
 # ____________________________________________________________
 # helpers for slow paths, moved out because they contain loops
diff --git a/pypy/objspace/std/bytesobject.py b/pypy/objspace/std/bytesobject.py
--- a/pypy/objspace/std/bytesobject.py
+++ b/pypy/objspace/std/bytesobject.py
@@ -661,6 +661,11 @@
     def descr_upper(self, space):
         return W_BytesObject(self._value.upper())
 
+    @staticmethod
+    def _iter_getitem_result(self, space, index):
+        assert isinstance(self, W_BytesObject)
+        return self._getitem_result(space, index)
+
 
 def _create_list_from_bytes(value):
     # need this helper function to allow the jit to look inside and inline
diff --git a/pypy/objspace/std/stringmethods.py b/pypy/objspace/std/stringmethods.py
--- a/pypy/objspace/std/stringmethods.py
+++ b/pypy/objspace/std/stringmethods.py
@@ -76,7 +76,7 @@
 
     def descr_iter(self, space):
         from pypy.objspace.std.iterobject import W_StringIterObject
-        return W_StringIterObject(self, self.__class__._getitem_result)
+        return W_StringIterObject(self, self._iter_getitem_result)
 
     def descr_contains(self, space, w_sub):
         value = self._val(space)
diff --git a/pypy/objspace/std/unicodeobject.py b/pypy/objspace/std/unicodeobject.py
--- a/pypy/objspace/std/unicodeobject.py
+++ b/pypy/objspace/std/unicodeobject.py
@@ -509,6 +509,11 @@
     def _starts_ends_overflow(self, prefix):
         return len(prefix) == 0
 
+    @staticmethod
+    def _iter_getitem_result(self, space, index):
+        assert isinstance(self, W_UnicodeObject)
+        return self._getitem_result(space, index)
+
 
 def _isidentifier(u):
     if not u:


More information about the pypy-commit mailing list