Antonio Cuni avatar 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

Comments (0)

Files changed (4)

 
 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

pypy/objspace/std/listobject.py

             l.reverse()
 
     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)
 
 # _______________________________________________________
 

pypy/objspace/std/objspace.py

             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:

pypy/objspace/std/setobject.py

         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
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.