Ejemplo n.º 1
0
 def __mul__(self,other):
     if self.parent() != other.parent():
         # should implement coercion here
         raise NotImplementedError
     if self.is_exact():
         return self
     if other.is_exact():
         return other
     if self.__class__ is other.__class__:
         return self._mul_(other)
     return coerce_bigoh(self,other,mul)
Ejemplo n.º 2
0
 def intersection(self,other):
     if self.parent() != other.parent(): 
         # should implement coercion here
         raise NotImplementedError
     if self.is_exact():
         return self
     if other.is_exact():
         return other
     if self.__class__ is other.__class__:
         return self._intersection(other)
     return coerce_bigoh(self,other,self.__class__.intersection)