[pypy-svn] r8888 - pypy/dist/pypy/objspace/std

pedronis at codespeak.net pedronis at codespeak.net
Sat Feb 5 00:14:27 CET 2005


Author: pedronis
Date: Sat Feb  5 00:14:27 2005
New Revision: 8888

Modified:
   pypy/dist/pypy/objspace/std/stdtypedef.py
   pypy/dist/pypy/objspace/std/typeobject.py
Log:
streamline hasdict and type creation logic more



Modified: pypy/dist/pypy/objspace/std/stdtypedef.py
==============================================================================
--- pypy/dist/pypy/objspace/std/stdtypedef.py	(original)
+++ pypy/dist/pypy/objspace/std/stdtypedef.py	Sat Feb  5 00:14:27 2005
@@ -101,7 +101,7 @@
         dict_w[descrname] = w(descrvalue)
 
     return W_TypeObject(space, typedef.name, bases_w, dict_w,
-                        overridetypedef=typedef, forcedict=False)
+                        overridetypedef=typedef)
 
 def hack_out_multimethods(ns):
     "NOT_RPYTHON: initialization-time only."

Modified: pypy/dist/pypy/objspace/std/typeobject.py
==============================================================================
--- pypy/dist/pypy/objspace/std/typeobject.py	(original)
+++ pypy/dist/pypy/objspace/std/typeobject.py	Sat Feb  5 00:14:27 2005
@@ -9,7 +9,7 @@
     from pypy.objspace.std.typetype import type_typedef as typedef
 
     def __init__(w_self, space, name, bases_w, dict_w,
-                 overridetypedef=None, forcedict=True):
+                 overridetypedef=None):
         W_Object.__init__(w_self, space)
         w_self.name = name
         w_self.bases_w = bases_w
@@ -34,10 +34,9 @@
                                                     "multiple inheritance"))
                 w_self.hasdict = w_self.hasdict or w_base.hasdict
             w_self.instancetypedef = instancetypedef
-         if forcedict and not w_self.hasdict:
-            w_self.dict_w['__dict__'] = space.wrap(std_dict_descr)
-            w_self.hasdict = True
-        if overridetypedef is None:
+            if not w_self.hasdict:
+                w_self.dict_w['__dict__'] = space.wrap(std_dict_descr)
+                w_self.hasdict = True                
             w_type = space.type(w_self)
             if not space.is_true(space.is_(w_type, space.w_type)):
                 mro_func = w_type.lookup('mro')
@@ -45,6 +44,7 @@
                 w_mro = space.call_args(mro_func, mro_func_args)
                 w_self.mro_w = space.unpackiterable(w_mro)
                 return
+
         w_self.mro_w = w_self.compute_mro()
 
     def compute_mro(w_self):



More information about the Pypy-commit mailing list