Author: Carl Friedrich Bolz <[email protected]>
Branch: py3k
Changeset: r64916:011a13df3ba7
Date: 2013-06-17 14:08 +0200
http://bitbucket.org/pypy/pypy/changeset/011a13df3ba7/

Log:    now that newlist_unicode exists, newlist_str needs to be for
        bytestrings. StringStrategy is still broken, so just fall back to
        the default of immediately wrapping things.

diff --git a/pypy/interpreter/baseobjspace.py b/pypy/interpreter/baseobjspace.py
--- a/pypy/interpreter/baseobjspace.py
+++ b/pypy/interpreter/baseobjspace.py
@@ -912,7 +912,7 @@
         return (None, None)
 
     def newlist_str(self, list_s):
-        return self.newlist([self.wrap(s) for s in list_s])
+        return self.newlist([self.wrapbytes(s) for s in list_s])
 
     def newlist_unicode(self, list_u):
         return self.newlist([self.wrap(u) for u in list_u])
diff --git a/pypy/objspace/std/listobject.py b/pypy/objspace/std/listobject.py
--- a/pypy/objspace/std/listobject.py
+++ b/pypy/objspace/std/listobject.py
@@ -163,13 +163,12 @@
             self.switch_to_object_strategy()
         return self
 
-    @staticmethod
-    def newlist_str(space, list_s):
-        # XXX: StringListStrategy is currently broken
-        #strategy = space.fromcache(StringListStrategy)
-        strategy = space.fromcache(UnicodeListStrategy)
-        storage = strategy.erase(list_s)
-        return W_ListObject.from_storage_and_strategy(space, storage, strategy)
+    # XXX: StringListStrategy is currently broken
+    #@staticmethod
+    #def newlist_str(space, list_s):
+    #    strategy = space.fromcache(StringListStrategy)
+    #    storage = strategy.erase(list_s)
+    #    return W_ListObject.from_storage_and_strategy(space, storage, 
strategy)
 
     @staticmethod
     def newlist_unicode(space, list_u):
diff --git a/pypy/objspace/std/objspace.py b/pypy/objspace/std/objspace.py
--- a/pypy/objspace/std/objspace.py
+++ b/pypy/objspace/std/objspace.py
@@ -314,8 +314,10 @@
         assert not list_w or sizehint == -1
         return W_ListObject(self, list_w, sizehint)
 
-    def newlist_str(self, list_s):
-        return W_ListObject.newlist_str(self, list_s)
+    # XXX: StringListStrategy is currently broken
+    # use the default implementation, which simply wraps
+    #def newlist_str(self, list_s):
+    #    return W_ListObject.newlist_str(self, list_s)
 
     def newlist_unicode(self, list_u):
         return W_ListObject.newlist_unicode(self, list_u)
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to