Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

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__