1. Pypy
  2. Untitled project
  3. pypy


Justin Peel  committed 12b651d

make isinstance_w not wrap a bool and unwrap it again

  • Participants
  • Parent commits e2a9e7d
  • Branches default

Comments (0)

Files changed (3)

File pypy/interpreter/baseobjspace.py

View file
  • Ignore whitespace
         return (self.findattr(w_obj, self.wrap("__getitem__")) is not None)
     def isinstance_w(self, w_obj, w_type):
-        return self.is_true(self.isinstance(w_obj, w_type))
+        return self._type_isinstance(w_obj, w_type)
     # The code below only works
     # for the simple case (new-style instance).

File pypy/objspace/descroperation.py

View file
  • Ignore whitespace
         return space._type_issubtype(w_sub, w_type)
     def isinstance(space, w_inst, w_type):
-        return space._type_isinstance(w_inst, w_type)
+        return space.wrap(space._type_isinstance(w_inst, w_type))
     def issubtype_allow_override(space, w_sub, w_type):
         w_check = space.lookup(w_type, "__subclasscheck__")

File pypy/objspace/std/objspace.py

View file
  • Ignore whitespace
     def _type_isinstance(self, w_inst, w_type):
         if isinstance(w_type, W_TypeObject):
-            return self.wrap(self.type(w_inst).issubtype(w_type))
+            return self.type(w_inst).issubtype(w_type)
         raise OperationError(self.w_TypeError, self.wrap("need type object"))