[pypy-svn] r58025 - in pypy/branch/tuple-nonresizable-395/pypy: interpreter module/__builtin__ objspace/std

fijal at codespeak.net fijal at codespeak.net
Tue Sep 9 21:58:21 CEST 2008


Author: fijal
Date: Tue Sep  9 21:58:20 2008
New Revision: 58025

Modified:
   pypy/branch/tuple-nonresizable-395/pypy/interpreter/function.py
   pypy/branch/tuple-nonresizable-395/pypy/module/__builtin__/interp_classobj.py
   pypy/branch/tuple-nonresizable-395/pypy/objspace/std/listobject.py
   pypy/branch/tuple-nonresizable-395/pypy/objspace/std/tupletype.py
   pypy/branch/tuple-nonresizable-395/pypy/objspace/std/typetype.py
Log:
Adapt few other places not to merge the list
Make hack in listobject.__init__ slightly different


Modified: pypy/branch/tuple-nonresizable-395/pypy/interpreter/function.py
==============================================================================
--- pypy/branch/tuple-nonresizable-395/pypy/interpreter/function.py	(original)
+++ pypy/branch/tuple-nonresizable-395/pypy/interpreter/function.py	Tue Sep  9 21:58:20 2008
@@ -213,7 +213,7 @@
             w(self.code),
             self.w_func_globals,
             w_closure,
-            nt(self.defs_w),
+            nt(self.defs_w[:]),
             self.w_func_dict,
             self.w_module,
         ]

Modified: pypy/branch/tuple-nonresizable-395/pypy/module/__builtin__/interp_classobj.py
==============================================================================
--- pypy/branch/tuple-nonresizable-395/pypy/module/__builtin__/interp_classobj.py	(original)
+++ pypy/branch/tuple-nonresizable-395/pypy/module/__builtin__/interp_classobj.py	Tue Sep  9 21:58:20 2008
@@ -116,7 +116,7 @@
             elif name == "__name__":
                 return space.wrap(self.name)
             elif name == "__bases__":
-                return space.newtuple(self.bases_w)
+                return space.newtuple(self.bases_w[:])
         w_value = self.lookup(space, w_attr)
         if w_value is None:
             raise OperationError(

Modified: pypy/branch/tuple-nonresizable-395/pypy/objspace/std/listobject.py
==============================================================================
--- pypy/branch/tuple-nonresizable-395/pypy/objspace/std/listobject.py	(original)
+++ pypy/branch/tuple-nonresizable-395/pypy/objspace/std/listobject.py	Tue Sep  9 21:58:20 2008
@@ -2,7 +2,6 @@
 from pypy.objspace.std.inttype import wrapint
 from pypy.objspace.std.listtype import get_list_index
 from pypy.objspace.std.sliceobject import W_SliceObject
-from pypy.objspace.std.tupleobject import W_TupleObject
 from pypy.objspace.std.seqinterface import W_SeqObject
 
 from pypy.objspace.std import slicetype
@@ -14,9 +13,9 @@
     from pypy.objspace.std.listtype import list_typedef as typedef
     
     def __init__(w_self, wrappeditems):
-        if len(wrappeditems) > 0:
-            elem = wrappeditems.pop()
-            wrappeditems.append(elem)
+        #if len(wrappeditems) > 0:
+        wrappeditems.append(None)
+        wrappeditems.pop()
         w_self.wrappeditems = wrappeditems
 
     def __repr__(w_self):

Modified: pypy/branch/tuple-nonresizable-395/pypy/objspace/std/tupletype.py
==============================================================================
--- pypy/branch/tuple-nonresizable-395/pypy/objspace/std/tupletype.py	(original)
+++ pypy/branch/tuple-nonresizable-395/pypy/objspace/std/tupletype.py	Tue Sep  9 21:58:20 2008
@@ -13,7 +13,7 @@
           space.is_w(space.type(w_sequence), space.w_tuple)):
         return w_sequence
     else:
-        tuple_w = space.unpackiterable(w_sequence)
+        tuple_w = space.viewiterable(w_sequence)
     w_obj = space.allocate_instance(space.TupleObjectCls, w_tupletype)
     space.TupleObjectCls.__init__(w_obj, tuple_w)
     return w_obj

Modified: pypy/branch/tuple-nonresizable-395/pypy/objspace/std/typetype.py
==============================================================================
--- pypy/branch/tuple-nonresizable-395/pypy/objspace/std/typetype.py	(original)
+++ pypy/branch/tuple-nonresizable-395/pypy/objspace/std/typetype.py	Tue Sep  9 21:58:20 2008
@@ -80,7 +80,7 @@
 
 def descr_get__mro__(space, w_type):
     w_type = _check(space, w_type)
-    return space.newtuple(w_type.mro_w)
+    return space.newtuple(w_type.mro_w[:])
 
 def descr_mro(space, w_type):
     """Return a type's method resolution order."""
@@ -89,7 +89,7 @@
 
 def descr_get__bases__(space, w_type):
     w_type = _check(space, w_type)
-    return space.newtuple(w_type.bases_w)
+    return space.newtuple(w_type.bases_w[:])
 
 def mro_subclasses(space, w_type, temp):
     from pypy.objspace.std.typeobject import W_TypeObject, compute_mro



More information about the Pypy-commit mailing list