def __add__(self, other): if isinstance(other, Signomial) and not isinstance( other, Polynomial): # pragma: no cover raise RuntimeError('Cannot add signomials to polynomials.') temp = Signomial.__add__(self, other) temp = temp.as_polynomial() return temp
def __add__(self, other): if isinstance(other, Signomial) and not isinstance(other, Polynomial): raise ValueError('Cannot add signomials to polynomials.') temp = Signomial.__add__(self, other) temp = temp.as_polynomial() return temp