示例#1
0
 def _type_isinstance(self, w_inst, w_type):
     if not isinstance(w_type, W_TypeObject):
         raise OperationError(self.w_TypeError,
                              self.wrap("need type object"))
     if is_annotation_constant(w_type):
         cls = self._get_interplevel_cls(w_type)
         if cls is not None:
             assert w_inst is not None
             if isinstance(w_inst, cls):
                 return True
     return self.type(w_inst).issubtype(w_type)
示例#2
0
 def f(arg):
     if is_annotation_constant(arg):
         return 1
     return 10