Exemple #1
0
 def repr(self):
     method = self.custom_interface.lookup_method(u"+repr")
     if method is None:
         return Object.repr(self)
     else:
         result = method.call([self])
         assert isinstance(result, space.String)
         return result.string
Exemple #2
0
 def repr(self):
     custom_interface = jit.promote(self.custom_interface)
     method = custom_interface.lookup_method(u"+repr")
     if method is None:
         return Object.repr(self)
     else:
         result = method.call([self])
         return space.cast(result, space.String, u"+repr cast").string
Exemple #3
0
 def repr(self):
     try:
         method = self.custom_interface.methods[u"+repr"]
     except KeyError as error:
         return Object.repr(self)
     else:
         result = method.call([self])
         assert isinstance(result, space.String)
         return result.string
Exemple #4
0
 def repr(self):
     try:
         method = self.custom_interface.methods[u"+repr"]
     except KeyError as error:
         return Object.repr(self)
     else:
         result = method.call([self])
         assert isinstance(result, space.String)
         return result.string