Пример #1
0
 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
Пример #2
0
 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