[pypy-svn] r20285 - pypy/branch/somepbc-refactoring/pypy/annotation

arigo at codespeak.net arigo at codespeak.net
Sat Nov 26 18:30:19 CET 2005


Author: arigo
Date: Sat Nov 26 18:30:19 2005
New Revision: 20285

Modified:
   pypy/branch/somepbc-refactoring/pypy/annotation/builtin.py
Log:
(pedronis, arigo)

Fixed instantiate(), broken in the annotator.  (It was already repaired in the
RTyper by the previous check-in.)



Modified: pypy/branch/somepbc-refactoring/pypy/annotation/builtin.py
==============================================================================
--- pypy/branch/somepbc-refactoring/pypy/annotation/builtin.py	(original)
+++ pypy/branch/somepbc-refactoring/pypy/annotation/builtin.py	Sat Nov 26 18:30:19 2005
@@ -232,15 +232,15 @@
 def robjmodel_instantiate(s_clspbc):
     assert isinstance(s_clspbc, SomePBC)
     clsdef = None
-    for cls, v in s_clspbc.prebuiltinstances.items():
+    more_than_one = len(s_clspbc.descriptions)
+    for desc in s_clspbc.descriptions:
+        cdef = desc.getuniqueclassdef()
+        if more_than_one:
+            getbookkeeper().needs_generic_instantiate[cdef] = True
         if not clsdef:
-            clsdef = getbookkeeper().getclassdef(cls)
+            clsdef = cdef
         else:
-            clsdef = clsdef.commonbase(getbookkeeper().getclassdef(cls))
-    if len(s_clspbc.prebuiltinstances) > 1:
-        for cls in s_clspbc.prebuiltinstances:
-            getbookkeeper().needs_generic_instantiate[cls] = True
-            XXX_FixMe
+            clsdef = clsdef.commonbase(cdef)
     return SomeInstance(clsdef)
 
 def robjmodel_we_are_translated():



More information about the Pypy-commit mailing list