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)
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)