return '({})'.format(string)
def __repr__(self):
- string = '{}({{'.format(self.__class__.__name__)
- for i, (symbol, coefficient) in enumerate(self.coefficients()):
- if i != 0:
- string += ', '
- string += '{!r}: {!r}'.format(symbol, coefficient)
- string += '}}, {!r})'.format(self.constant)
- return string
+ return '{}({!r})'.format(self.__class__.__name__, str(self))
@_polymorphic_method
def __eq__(self, other):
constraints.append('{} == 0'.format(constraint))
for constraint in self.inequalities:
constraints.append('{} >= 0'.format(constraint))
- return '{{{}}}'.format(', '.join(constraints))
+ return '{}'.format(', '.join(constraints))
def __repr__(self):
if self.isempty():
elif self.isuniverse():
return 'Universe'
else:
- equalities = list(self.equalities)
- inequalities = list(self.inequalities)
- return '{}(equalities={!r}, inequalities={!r})' \
- ''.format(self.__class__.__name__, equalities, inequalities)
+ return '{}({!r})'.format(self.__class__.__name__, str(self))
@classmethod
def _fromsympy(cls, expr):