return False
def __bool__(self):
- True
+ return True
def __pos__(self):
return self
self.constant == other.constant
def __hash__(self):
- return hash((self._coefficients, self._constant))
+ return hash((tuple(sorted(self._coefficients.items())), self._constant))
def _toint(self):
lcm = functools.reduce(lambda a, b: a*b // gcd(a, b),
def symbols(names):
if isinstance(names, str):
names = names.replace(',', ' ').split()
- return (symbol(name) for name in names)
+ return (Symbol(name) for name in names)
@_polymorphic_operator