Ejemplo n.º 1
0
 def hash(self):
     method = self.custom_interface.lookup_method(u"+hash")
     if method is None:
         return Object.hash(self)
     else:
         result = method.call([self])
         assert isinstance(result, space.Integer)
         return int(result.value)
Ejemplo n.º 2
0
 def hash(self):
     custom_interface = jit.promote(self.custom_interface)
     method = custom_interface.lookup_method(u"+hash")
     if method is None:
         return Object.hash(self)
     else:
         result = method.call([self])
         return int(space.cast(result, space.Integer, u"+hash cast").value)
Ejemplo n.º 3
0
 def hash(self):
     try:
         method = self.custom_interface.methods[u"+hash"]
     except KeyError as error:
         return Object.hash(self)
     else:
         result = method.call([self])
         assert isinstance(result, space.Integer)
         return int(result.value)
Ejemplo n.º 4
0
 def hash(self):
     try:
         method = self.custom_interface.methods[u"+hash"]
     except KeyError as error:
         return Object.hash(self)
     else:
         result = method.call([self])
         assert isinstance(result, space.Integer)
         return int(result.value)