[pypy-commit] pypy default: add space.issubtype_w

pjenvey pypy.commits at gmail.com
Sun May 22 14:18:49 EDT 2016


Author: Philip Jenvey <pjenvey at underboss.org>
Branch: 
Changeset: r84578:a9c6fa0a813c
Date: 2016-05-22 11:16 -0700
http://bitbucket.org/pypy/pypy/changeset/a9c6fa0a813c/

Log:	add space.issubtype_w

diff --git a/pypy/objspace/descroperation.py b/pypy/objspace/descroperation.py
--- a/pypy/objspace/descroperation.py
+++ b/pypy/objspace/descroperation.py
@@ -495,8 +495,11 @@
                         "coercion should return None or 2-tuple")
         return w_res
 
+    def issubtype_w(space, w_sub, w_type):
+        return space._type_issubtype(w_sub, w_type)
+
     def issubtype(space, w_sub, w_type):
-        return space._type_issubtype(w_sub, w_type)
+        return space.wrap(space._type_issubtype(w_sub, w_type))
 
     @specialize.arg_or_var(2)
     def isinstance_w(space, w_inst, w_type):
diff --git a/pypy/objspace/std/objspace.py b/pypy/objspace/std/objspace.py
--- a/pypy/objspace/std/objspace.py
+++ b/pypy/objspace/std/objspace.py
@@ -617,7 +617,7 @@
 
     def _type_issubtype(self, w_sub, w_type):
         if isinstance(w_sub, W_TypeObject) and isinstance(w_type, W_TypeObject):
-            return self.wrap(w_sub.issubtype(w_type))
+            return w_sub.issubtype(w_type)
         raise oefmt(self.w_TypeError, "need type objects")
 
     @specialize.arg_or_var(2)


More information about the pypy-commit mailing list