[pypy-commit] pypy kill-unary-multimethods: just removing isinstance and issubtype as multimethods seems to "just work".

fijal noreply at buildbot.pypy.org
Fri Sep 16 18:22:05 CEST 2011


Author: Maciej Fijalkowski <fijall at gmail.com>
Branch: kill-unary-multimethods
Changeset: r47300:96571e83c308
Date: 2011-09-16 12:02 +0200
http://bitbucket.org/pypy/pypy/changeset/96571e83c308/

Log:	just removing isinstance and issubtype as multimethods seems to
	"just work". Weird but ok

diff --git a/pypy/interpreter/baseobjspace.py b/pypy/interpreter/baseobjspace.py
--- a/pypy/interpreter/baseobjspace.py
+++ b/pypy/interpreter/baseobjspace.py
@@ -1394,8 +1394,6 @@
     ('is_',             'is',        2, []),
     ('id',              'id',        1, []),
     ('type',            'type',      1, []),
-    ('isinstance',      'isinstance', 2, ['__instancecheck__']),
-    ('issubtype',       'issubtype', 2, ['__subclasscheck__']),  # not for old-style classes
     ('repr',            'repr',      1, ['__repr__']),
     ('str',             'str',       1, ['__str__']),
     ('format',          'format',    2, ['__format__']),
diff --git a/pypy/objspace/descroperation.py b/pypy/objspace/descroperation.py
--- a/pypy/objspace/descroperation.py
+++ b/pypy/objspace/descroperation.py
@@ -872,7 +872,7 @@
             _impl_maker = _make_unaryop_impl
         if _impl_maker:
             setattr(DescrOperation,_name,_impl_maker(_symbol,_specialnames))
-        elif _name not in ['is_', 'id','type','issubtype',
+        elif _name not in ['is_', 'id','type',
                            # not really to be defined in DescrOperation
                            'ord', 'unichr', 'unicode']:
             raise Exception, "missing def for operation %s" % _name
diff --git a/pypy/objspace/std/builtinshortcut.py b/pypy/objspace/std/builtinshortcut.py
--- a/pypy/objspace/std/builtinshortcut.py
+++ b/pypy/objspace/std/builtinshortcut.py
@@ -39,7 +39,6 @@
                  'abs', 'hex', 'oct',             # rare stuff?
                  'pos', 'divmod', 'cmp',          # rare stuff?
                  'float', 'long', 'coerce',       # rare stuff?
-                 'isinstance', 'issubtype',
                  ]
 # We cannot support {get,set,del}slice right now because
 # DescrOperation.{get,set,del}slice do a bit more work than just call
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
@@ -868,12 +868,6 @@
 def _pure_issubtype(w_sub, w_type, version_tag1, version_tag2):
     return _issubtype(w_sub, w_type)
 
-def issubtype__Type_Type(space, w_type, w_sub):
-    return space.newbool(w_sub.issubtype(w_type))
-
-def isinstance__Type_ANY(space, w_type, w_inst):
-    return space.newbool(space.type(w_inst).issubtype(w_type))
-
 def repr__Type(space, w_obj):
     w_mod = w_obj.get_module()
     if not space.isinstance_w(w_mod, space.w_str):


More information about the pypy-commit mailing list