[pypy-svn] r13814 - in pypy/branch/pypy-translation-snapshot: interpreter objspace/std

arigo at codespeak.net arigo at codespeak.net
Fri Jun 24 16:55:55 CEST 2005


Author: arigo
Date: Fri Jun 24 16:55:54 2005
New Revision: 13814

Modified:
   pypy/branch/pypy-translation-snapshot/interpreter/pycode.py
   pypy/branch/pypy-translation-snapshot/objspace/std/listobject.py
   pypy/branch/pypy-translation-snapshot/objspace/std/model.py
   pypy/branch/pypy-translation-snapshot/objspace/std/objspace.py
Log:
Merge of rev 13813 into the pypy-translation-snapshot.


Modified: pypy/branch/pypy-translation-snapshot/interpreter/pycode.py
==============================================================================
--- pypy/branch/pypy-translation-snapshot/interpreter/pycode.py	(original)
+++ pypy/branch/pypy-translation-snapshot/interpreter/pycode.py	Fri Jun 24 16:55:54 2005
@@ -48,7 +48,7 @@
 NESTED    = 1
 GENERATOR = 2
 
-frame_classes = {}
+frame_classes = []
 
 def setup_frame_classes():
     "NOT_RPYTHON"
@@ -66,6 +66,7 @@
                 dic[n] = func_with_new_name(x, x.__name__)
         return dic
 
+    frame_classes.extend([None]*4)
     frame_classes[0]                = PyInterpFrame
     frame_classes[NESTED]           = PyNestedScopeFrame
     frame_classes[GENERATOR]        = type('PyGeneratorFrame',

Modified: pypy/branch/pypy-translation-snapshot/objspace/std/listobject.py
==============================================================================
--- pypy/branch/pypy-translation-snapshot/objspace/std/listobject.py	(original)
+++ pypy/branch/pypy-translation-snapshot/objspace/std/listobject.py	Fri Jun 24 16:55:54 2005
@@ -597,20 +597,23 @@
         assert isinstance(b, KeyContainer)
         return CustomCompareSort.lt(self, a.w_key, b.w_key)
 
-SortClass = {
-    (False, False): SimpleSort,
-    (True,  False): CustomCompareSort,
-    (False, True) : CustomKeySort,
-    (True,  True) : CustomKeyCompareSort,
-    }
-
 def list_sort__List_ANY_ANY_ANY(space, w_list, w_cmp, w_keyfunc, w_reverse):
     has_cmp = not space.is_w(w_cmp, space.w_None)
     has_key = not space.is_w(w_keyfunc, space.w_None)
     has_reverse = space.is_true(w_reverse)
 
     # create and setup a TimSort instance
-    sorterclass = SortClass[has_cmp, has_key]
+    if has_cmp: 
+        if has_key: 
+            sorterclass = CustomKeyCompareSort
+        else: 
+            sorterclass = CustomCompareSort
+    else: 
+        if has_key: 
+            sorterclass = CustomKeySort
+        else: 
+            sorterclass = SimpleSort
+            
     sorter = sorterclass(w_list.ob_item, w_list.ob_size)
     sorter.space = space
     sorter.w_cmp = w_cmp

Modified: pypy/branch/pypy-translation-snapshot/objspace/std/model.py
==============================================================================
--- pypy/branch/pypy-translation-snapshot/objspace/std/model.py	(original)
+++ pypy/branch/pypy-translation-snapshot/objspace/std/model.py	Fri Jun 24 16:55:54 2005
@@ -136,7 +136,6 @@
             specialnames = [operatorsymbol]
         self.specialnames = specialnames  # e.g. ['__xxx__', '__rxxx__']
         self.extras = extras
-        self.unbound_versions = {}
         # transform  '+'  =>  'add'  etc.
         for line in ObjSpace.MethodTable:
             realname, symbolname = line[:2]

Modified: pypy/branch/pypy-translation-snapshot/objspace/std/objspace.py
==============================================================================
--- pypy/branch/pypy-translation-snapshot/objspace/std/objspace.py	(original)
+++ pypy/branch/pypy-translation-snapshot/objspace/std/objspace.py	Fri Jun 24 16:55:54 2005
@@ -66,7 +66,6 @@
         self.w_Ellipsis = self.wrap(Ellipsis(self))  
 
         # types
-        self.types_w = {}
         for typedef in self.model.pythontypes:
             w_type = self.gettypeobject(typedef)
             setattr(self, 'w_' + typedef.name, w_type)
@@ -180,7 +179,7 @@
         return ec
 
     def gettypeobject(self, typedef):
-        # types_w maps each StdTypeDef instance to its
+        # stdtypedef.TypeCache maps each StdTypeDef instance to its
         # unique-for-this-space W_TypeObject instance
         return self.fromcache(stdtypedef.TypeCache).getorbuild(typedef)
 



More information about the Pypy-commit mailing list