[pypy-svn] r36407 - in pypy/dist/pypy/objspace/std: . test

cfbolz at codespeak.net cfbolz at codespeak.net
Wed Jan 10 15:47:39 CET 2007


Author: cfbolz
Date: Wed Jan 10 15:47:38 2007
New Revision: 36407

Modified:
   pypy/dist/pypy/objspace/std/test/test_versionedtype.py
   pypy/dist/pypy/objspace/std/typeobject.py
   pypy/dist/pypy/objspace/std/typetype.py
Log:
(pedronis, cfbolz): on second thought, if somebody changes bases he deserves
not getting caching.


Modified: pypy/dist/pypy/objspace/std/test/test_versionedtype.py
==============================================================================
--- pypy/dist/pypy/objspace/std/test/test_versionedtype.py	(original)
+++ pypy/dist/pypy/objspace/std/test/test_versionedtype.py	Wed Jan 10 15:47:38 2007
@@ -62,7 +62,7 @@
                 pass
             B.__bases__ = (D, )
         """)
-        assert w_B.version_tag is not btag
+        assert w_B.version_tag is None
 
 
 class AppTestVersionedType(test_typeobject.AppTestTypeObject):

Modified: pypy/dist/pypy/objspace/std/typeobject.py
==============================================================================
--- pypy/dist/pypy/objspace/std/typeobject.py	(original)
+++ pypy/dist/pypy/objspace/std/typeobject.py	Wed Jan 10 15:47:38 2007
@@ -445,7 +445,6 @@
     # but it is needed at bootstrap to avoid a call to w_type.getdict() which
     # would un-lazify the whole type.
     if space.config.objspace.std.withtypeversion:
-        # also takes care of assignments to __bases__
         w_type.mutated()
     name = space.str_w(w_name)
     w_descr = space.lookup(w_type, name)

Modified: pypy/dist/pypy/objspace/std/typetype.py
==============================================================================
--- pypy/dist/pypy/objspace/std/typetype.py	(original)
+++ pypy/dist/pypy/objspace/std/typetype.py	Wed Jan 10 15:47:38 2007
@@ -170,6 +170,9 @@
         raise OperationError(space.w_TypeError,
                              space.wrap("__bases__ assignment: '%s' object layout differs from '%s'" %
                                         (w_type.getname(space, '?'), new_base.getname(space, '?'))))
+    if space.config.objspace.std.withtypeversion:
+        # it does not make sense to cache this type, it changes bases
+        w_type.version_tag = None
 
     saved_bases = w_type.bases_w
     saved_base = w_type.w_bestbase



More information about the Pypy-commit mailing list