[pypy-commit] pypy list-strategies: Use new method _temporarily_as_objects in extend, too

l.diekmann noreply at buildbot.pypy.org
Fri Sep 23 13:13:03 CEST 2011


Author: Lukas Diekmann <lukas.diekmann at uni-duesseldorf.de>
Branch: list-strategies
Changeset: r47494:71c4ed6fd9da
Date: 2011-03-30 16:21 +0200
http://bitbucket.org/pypy/pypy/changeset/71c4ed6fd9da/

Log:	Use new method _temporarily_as_objects in extend, too

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
@@ -526,14 +526,8 @@
             return
         elif w_other.strategy is self.space.fromcache(EmptyListStrategy):
             return
-        #XXX use _temporarily_as_objects here
-        list_w = w_other.getitems()
-        strategy = self.space.fromcache(ObjectListStrategy)
-        storage = strategy.cast_to_void_star(list_w)
-        # NB: w_other shares its storage with the original w_other.  the new
-        # w_other does not survive long, so this is not a problem
-        w_other = W_ListObject.from_storage_and_strategy(self.space, storage, strategy)
 
+        w_other = w_other._temporarily_as_objects()
         w_list.switch_to_object_strategy()
         w_list.extend(w_other)
 


More information about the pypy-commit mailing list