[pypy-svn] r73143 - pypy/branch/cleanup-objspace-init/pypy/objspace/std

benjamin at codespeak.net benjamin at codespeak.net
Mon Mar 29 23:58:13 CEST 2010


Author: benjamin
Date: Mon Mar 29 23:58:12 2010
New Revision: 73143

Modified:
   pypy/branch/cleanup-objspace-init/pypy/objspace/std/objspace.py
   pypy/branch/cleanup-objspace-init/pypy/objspace/std/tupletype.py
Log:
remove wraptuple

Modified: pypy/branch/cleanup-objspace-init/pypy/objspace/std/objspace.py
==============================================================================
--- pypy/branch/cleanup-objspace-init/pypy/objspace/std/objspace.py	(original)
+++ pypy/branch/cleanup-objspace-init/pypy/objspace/std/objspace.py	Mon Mar 29 23:58:12 2010
@@ -35,7 +35,6 @@
 # types
 from pypy.objspace.std.inttype import wrapint
 from pypy.objspace.std.stringtype import wrapstr
-from pypy.objspace.std.tupletype import wraptuple
 from pypy.objspace.std.unicodetype import wrapunicode
 
 
@@ -280,7 +279,7 @@
     def newtuple(self, list_w):
         assert isinstance(list_w, list)
         make_sure_not_resized(list_w)
-        return wraptuple(self, list_w)
+        return W_TupleObject(list_w)
 
     def newlist(self, list_w):
         return W_ListObject(list_w)

Modified: pypy/branch/cleanup-objspace-init/pypy/objspace/std/tupletype.py
==============================================================================
--- pypy/branch/cleanup-objspace-init/pypy/objspace/std/tupletype.py	(original)
+++ pypy/branch/cleanup-objspace-init/pypy/objspace/std/tupletype.py	Mon Mar 29 23:58:12 2010
@@ -1,10 +1,6 @@
 from pypy.interpreter import gateway
 from pypy.objspace.std.stdtypedef import StdTypeDef
 
-def wraptuple(space, list_w):
-    from pypy.objspace.std.tupleobject import W_TupleObject
-    return W_TupleObject(list_w)
-
 def descr__new__(space, w_tupletype, w_sequence=gateway.NoneNotWrapped):
     from pypy.objspace.std.tupleobject import W_TupleObject
     if w_sequence is None:
@@ -14,8 +10,8 @@
         return w_sequence
     else:
         tuple_w = space.fixedview(w_sequence)
-    w_obj = space.allocate_instance(space.TupleObjectCls, w_tupletype)
-    space.TupleObjectCls.__init__(w_obj, tuple_w)
+    w_obj = space.allocate_instance(W_TupleObject, w_tupletype)
+    W_TupleObject.__init__(w_obj, tuple_w)
     return w_obj
 
 # ____________________________________________________________



More information about the Pypy-commit mailing list