Author: Manuel Jacob
Branch: remove-remaining-smm
Changeset: r69373:741db1af98fd
Date: 2014-02-24 22:13 +0100
http://bitbucket.org/pypy/pypy/changeset/741db1af98fd/

Log:    Kill type_typedef, use W_TypeObject.typedef directly.

diff --git a/pypy/objspace/std/model.py b/pypy/objspace/std/model.py
--- a/pypy/objspace/std/model.py
+++ b/pypy/objspace/std/model.py
@@ -30,10 +30,6 @@
         """NOT_RPYTHON: inititialization only"""
         self.config = config
         # All the Python types that we want to provide in this StdObjSpace
-        class result:
-            from pypy.objspace.std.typeobject   import type_typedef
-        self.pythontypes = [value for key, value in result.__dict__.items()
-                            if not key.startswith('_')]   # don't look
 
         # The object implementations that we want to 'link' into PyPy must be
         # imported here.  This registers them into the multimethod tables,
@@ -62,9 +58,10 @@
 
         import pypy.objspace.std.marshal_impl # install marshal multimethods
 
-        # not-multimethod based types
 
+        self.pythontypes = []
         self.pythontypes.append(objectobject.W_ObjectObject.typedef)
+        self.pythontypes.append(typeobject.W_TypeObject.typedef)
         self.pythontypes.append(noneobject.W_NoneObject.typedef)
         self.pythontypes.append(tupleobject.W_TupleObject.typedef)
         self.pythontypes.append(listobject.W_ListObject.typedef)
diff --git a/pypy/objspace/std/typeobject.py b/pypy/objspace/std/typeobject.py
--- a/pypy/objspace/std/typeobject.py
+++ b/pypy/objspace/std/typeobject.py
@@ -855,7 +855,7 @@
 def type_isinstance(w_obj, space, w_inst):
     return space.newbool(space.type(w_inst).issubtype(w_obj))
 
-type_typedef = StdTypeDef("type",
+W_TypeObject.typedef = StdTypeDef("type",
     __new__ = gateway.interp2app(descr__new__),
     __name__ = GetSetProperty(descr_get__name__, descr_set__name__),
     __bases__ = GetSetProperty(descr_get__bases__, descr_set__bases__),
@@ -880,7 +880,7 @@
     __eq__ = gateway.interp2app(W_TypeObject.descr_eq),
     __ne__ = gateway.interp2app(W_TypeObject.descr_ne),
 )
-W_TypeObject.typedef = type_typedef
+
 
 # ____________________________________________________________
 # Initialization of type objects
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to