Пример #1
0
 def contains(self, obj):
     custom_interface = jit.promote(self.custom_interface)
     method = custom_interface.lookup_method(u"+contains")
     if method is None:
         return Object.contains(self, obj)
     else:
         return space.is_true(method.call([self, obj]))
Пример #2
0
 def contains(self, obj):
     try:
         method = self.custom_interface.methods[u"+contains"]
     except KeyError as error:
         return Object.contains(self, obj)
     else:
         return space.is_true(method.call([self, obj]))
Пример #3
0
 def contains(self, obj):
     try:
         method = self.custom_interface.methods[u"+contains"]
     except KeyError as error:
         return Object.contains(self, obj)
     else:
         return space.is_true(method.call([self, obj]))