[pypy-commit] pypy kill-multimethod: Kill W_Object.

Manuel Jacob noreply at buildbot.pypy.org
Tue Feb 25 18:22:52 CET 2014


Author: Manuel Jacob
Branch: kill-multimethod
Changeset: r69437:39f12449bcb7
Date: 2014-02-25 18:21 +0100
http://bitbucket.org/pypy/pypy/changeset/39f12449bcb7/

Log:	Kill W_Object.

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
@@ -13,22 +13,3 @@
 BINARY_OPS = dict(add='+', div='/', floordiv='//', mod='%', mul='*', sub='-',
                   truediv='/', **BINARY_BITWISE_OPS)
 COMMUTATIVE_OPS = ('add', 'mul', 'and', 'or', 'xor')
-
-
-# ____________________________________________________________
-
-class W_Object(W_Root):
-    "Parent base class for wrapped objects provided by the StdObjSpace."
-    # Note that not all wrapped objects in the interpreter inherit from
-    # W_Object.  (They inherit from W_Root.)
-    __slots__ = ()
-
-    def __repr__(self):
-        name = getattr(self, 'name', '')
-        if not isinstance(name, str):
-            name = ''
-        s = '%s(%s)' % (self.__class__.__name__, name)
-        w_cls = getattr(self, 'w__class__', None)
-        if w_cls is not None and w_cls is not self:
-            s += ' instance of %s' % self.w__class__
-        return '<%s>' % s
diff --git a/pypy/objspace/std/proxyobject.py b/pypy/objspace/std/proxyobject.py
--- a/pypy/objspace/std/proxyobject.py
+++ b/pypy/objspace/std/proxyobject.py
@@ -2,13 +2,8 @@
 """ transparent list implementation
 """
 
-from pypy.objspace.std.model import W_Object
+from pypy.interpreter import baseobjspace
 from pypy.interpreter.error import OperationError
-from pypy.interpreter import baseobjspace
-
-#class W_Transparent(W_Object):
-#    def __init__(self, w_controller):
-#        self.controller = w_controller
 
 
 def transparent_class(name, BaseCls):
@@ -72,7 +67,6 @@
     return W_Transparent
 
 W_Transparent = transparent_class('W_Transparent', baseobjspace.W_Root)
-#W_TransparentObject = transparent_class('W_TransparentObject', W_Object)
 
 #from pypy.objspace.std.objecttype import object_typedef
 #W_TransparentObject.typedef = object_typedef
diff --git a/pypy/objspace/std/test/test_typeobject.py b/pypy/objspace/std/test/test_typeobject.py
--- a/pypy/objspace/std/test/test_typeobject.py
+++ b/pypy/objspace/std/test/test_typeobject.py
@@ -1,13 +1,12 @@
-from pypy.objspace.std.model import W_Object
+from pypy.interpreter.baseobjspace import W_Root
+from pypy.interpreter.gateway import interp2app
 from pypy.objspace.std.stdtypedef import StdTypeDef
 
-from pypy.interpreter.gateway import interp2app
-
 
 class TestTypeObject:
     def test_not_acceptable_as_base_class(self):
         space = self.space
-        class W_Stuff(W_Object):
+        class W_Stuff(W_Root):
             pass
         def descr__new__(space, w_subtype):
             return space.allocate_instance(W_Stuff, w_subtype)
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
@@ -5,7 +5,6 @@
 from pypy.interpreter.typedef import weakref_descr, GetSetProperty,\
      descr_get_dict
 from pypy.interpreter.astcompiler.misc import mangle
-from pypy.objspace.std.model import W_Object
 from pypy.objspace.std.stdtypedef import std_dict_descr, issubtypedef, Member
 from pypy.objspace.std.stdtypedef import StdTypeDef
 
@@ -56,7 +55,7 @@
 COMPARES_BY_IDENTITY = 1
 OVERRIDES_EQ_CMP_OR_HASH = 2
 
-class W_TypeObject(W_Object):
+class W_TypeObject(W_Root):
     lazyloaders = {} # can be overridden by specific instances
 
     # the version_tag changes if the dict or the inheritance hierarchy changes


More information about the pypy-commit mailing list