[pypy-svn] r37378 - pypy/dist/pypy/objspace/fake

antocuni at codespeak.net antocuni at codespeak.net
Fri Jan 26 12:38:07 CET 2007


Author: antocuni
Date: Fri Jan 26 12:38:06 2007
New Revision: 37378

Modified:
   pypy/dist/pypy/objspace/fake/checkmodule.py
   pypy/dist/pypy/objspace/fake/objspace.py
Log:
We don't need to store the wrapped values in the fake objectspace.



Modified: pypy/dist/pypy/objspace/fake/checkmodule.py
==============================================================================
--- pypy/dist/pypy/objspace/fake/checkmodule.py	(original)
+++ pypy/dist/pypy/objspace/fake/checkmodule.py	Fri Jan 26 12:38:06 2007
@@ -79,7 +79,7 @@
 
     gateways = find_gateways(modname, basepath, module)
     functions = [gw.__spacebind__(space) for gw in gateways]
-    arguments = AbstractArguments.frompacked(space, W_Object(None), W_Object(None))
+    arguments = AbstractArguments.frompacked(space, W_Object(), W_Object())
     dummy_function = copy(functions[0])
 
     def main(argv): # use the standalone mode not to allow SomeObject

Modified: pypy/dist/pypy/objspace/fake/objspace.py
==============================================================================
--- pypy/dist/pypy/objspace/fake/objspace.py	(original)
+++ pypy/dist/pypy/objspace/fake/objspace.py	Fri Jan 26 12:38:06 2007
@@ -6,11 +6,10 @@
     pass
 
 class W_Object(W_Root):
-    def __init__(self, value):
-        self.value = value
+    pass
 W_Object.typedef = W_Type()
 
-def make_dummy(a=W_Object(None), b=W_Object(None)):
+def make_dummy(a=W_Object(), b=W_Object()):
     def fn(*args):
         if NonConstant(True):
             return a
@@ -25,23 +24,23 @@
 bool_dummy  = make_dummy(True, False)
 
 class FakeObjSpace(ObjSpace):
-    w_None           = W_Object(None)
-    w_False          = W_Object(None)
-    w_True           = W_Object(None)
-    w_Ellipsis       = W_Object(None)
-    w_NotImplemented = W_Object(None)
-    w_int            = W_Object(None)
-    w_dict           = W_Object(None)
-    w_float          = W_Object(None)
-    w_long           = W_Object(None)
-    w_tuple          = W_Object(None)
-    w_str            = W_Object(None)
-    w_unicode        = W_Object(None)
-    w_type           = W_Object(None)
-    w_instance       = W_Object(None)
-    w_slice          = W_Object(None)
-    w_hex            = W_Object(None)
-    w_oct            = W_Object(None)
+    w_None           = W_Object()
+    w_False          = W_Object()
+    w_True           = W_Object()
+    w_Ellipsis       = W_Object()
+    w_NotImplemented = W_Object()
+    w_int            = W_Object()
+    w_dict           = W_Object()
+    w_float          = W_Object()
+    w_long           = W_Object()
+    w_tuple          = W_Object()
+    w_str            = W_Object()
+    w_unicode        = W_Object()
+    w_type           = W_Object()
+    w_instance       = W_Object()
+    w_slice          = W_Object()
+    w_hex            = W_Object()
+    w_oct            = W_Object()
     
     def initialize(self):
         self.config.objspace.geninterp = False
@@ -55,12 +54,12 @@
         if isinstance(x, Wrappable):
             w_result = x.__spacebind__(self)
             return w_result
-        return W_Object(x)
+        return W_Object()
     wrap._annspecialcase_ = "specialize:argtype(1)"
 
     def unwrap(self, w_obj):
         assert isinstance(w_obj, W_Object)
-        return w_obj.value
+        return None
 
     lookup            = make_dummy()
     allocate_instance = make_dummy()
@@ -135,11 +134,11 @@
 
     gettypefor     = make_dummy()
     gettypeobject  = make_dummy()
-    unpackiterable = make_dummy([W_Object(None)], [W_Object(None)])
+    unpackiterable = make_dummy([W_Object()], [W_Object()])
 
 
 ## Register all exceptions
 import exceptions
 for name in ObjSpace.ExceptionTable:
     exc = getattr(exceptions, name)
-    setattr(FakeObjSpace, 'w_' + name, W_Object(None))
+    setattr(FakeObjSpace, 'w_' + name, W_Object())



More information about the Pypy-commit mailing list