1. Konstantin Lopuhin
  2. pypy


Antonio Cuni  committed d0c1cb8

attempt to re-enable space.listview_str. It was disabled because some strategies implemented it for unicode and some for bytes, so translation failed. We decide that listview_str is only for bytes, and that we will need to grow the equivalent unicode ones

  • Participants
  • Parent commits edf12e6
  • Branches py3k-listview_str

Comments (0)

Files changed (4)


View file
  • Ignore whitespace
 re-enable IntDictStrategy
-re-enable StdObjSpace.listview_str
+write strategies for unicode list/dict/set, and add StdObjSpace.listview_unicode & co.
 re-enable the kwargs dict strategy in dictmultiobject.py
 re-enable view_as_kwargs

File pypy/objspace/std/listobject.py

View file
  • Ignore whitespace
     def getitems_str(self, w_list):
-        return self.unerase(w_list.lstorage)
+        return None # note that getitems_str is for bytes, not unicode
+        #return self.unerase(w_list.lstorage)
 # _______________________________________________________

File pypy/objspace/std/objspace.py

View file
  • Ignore whitespace
             raise self._wrap_expected_length(expected_length, len(t))
         return t
-    def __disabled_listview_str(self, w_obj):
+    def listview_str(self, w_obj):
+        """
+        return a list of RPython bytes strings
+        """
         # note: uses exact type checking for objects with strategies,
         # and isinstance() for others.  See test_listobject.test_uses_custom...
         if type(w_obj) is W_ListObject:

File pypy/objspace/std/setobject.py

View file
  • Ignore whitespace
         return {}
     def listview_str(self, w_set):
-        return self.unerase(w_set.sstorage).keys()
+        return None # this is for bytes, not unicode
+        #return self.unerase(w_set.sstorage).keys()
     def is_correct_type(self, w_key):
         return type(w_key) is W_UnicodeObject