[pypy-svn] r26479 - in pypy/dist/pypy/rpython: ootypesystem test

nik at codespeak.net nik at codespeak.net
Fri Apr 28 04:18:35 CEST 2006


Author: nik
Date: Fri Apr 28 04:18:30 2006
New Revision: 26479

Modified:
   pypy/dist/pypy/rpython/ootypesystem/rdict.py
   pypy/dist/pypy/rpython/test/test_rdict.py
Log:
get rid of the ForwardReference scheme in ootypesystem DictRepr, use
lazy Dict type initialization instead.


Modified: pypy/dist/pypy/rpython/ootypesystem/rdict.py
==============================================================================
--- pypy/dist/pypy/rpython/ootypesystem/rdict.py	(original)
+++ pypy/dist/pypy/rpython/ootypesystem/rdict.py	Fri Apr 28 04:18:30 2006
@@ -35,7 +35,7 @@
         if already_computed:
             self.DICT = ootype.Dict(key_repr.lowleveltype, value_repr.lowleveltype)
         else:
-            self.DICT = ootype.ForwardReference()
+            self.DICT = ootype.Dict()
         self.lowleveltype = self.DICT
 
         self.dictkey = dictkey
@@ -51,9 +51,9 @@
         if 'value_repr' not in self.__dict__:
             self.external_value_repr, self.value_repr = self.pickrepr(self._value_repr_computer())
             
-        if isinstance(self.DICT, ootype.ForwardReference):
-            self.lowleveltype.become(ootype.Dict(self.key_repr.lowleveltype,
-                                                 self.value_repr.lowleveltype))
+        if not ootype.hasDictTypes(self.DICT):
+            ootype.setDictTypes(self.DICT, self.key_repr.lowleveltype,
+                    self.value_repr.lowleveltype)
 
     def send_message(self, hop, message, can_raise=False, v_args=None):
         if v_args is None:

Modified: pypy/dist/pypy/rpython/test/test_rdict.py
==============================================================================
--- pypy/dist/pypy/rpython/test/test_rdict.py	(original)
+++ pypy/dist/pypy/rpython/test/test_rdict.py	Fri Apr 28 04:18:30 2006
@@ -894,7 +894,6 @@
         assert self.interpret(func, ()) == 0
 
     def test_recursive(self):
-        py.test.skip("work-in-progress")
         def func(i):
             dic = {i: {}}
             dic[i] = dic



More information about the Pypy-commit mailing list