from __future__ import print_function, division class DefaultPrinting(object): """ The default implementation of printing for SymPy classes. This implements a hack that allows us to print elements of built-in Python containers in a readable way. Natively Python uses ``repr()`` even if ``str()`` was explicitly requested. Mix in this trait into a class to get proper default printing. """ # Note, we always use the default ordering (lex) in __str__ and __repr__, # regardless of the global setting. See issue 5487. def __str__(self): from sympy.printing.str import sstr return sstr(self, order=None) __repr__ = __str__