sympy.interactive -- rework init_printing to support different stringifiers
commit53555bed5d3531c88fa7f97b7040d70e34a3b9cd
authorKirill Smelkov <kirr@landau.phys.spbu.ru>
Sat, 9 Aug 2008 12:40:52 +0000 (9 16:40 +0400)
committerKirill Smelkov <kirr@landau.phys.spbu.ru>
Sat, 9 Aug 2008 12:40:52 +0000 (9 16:40 +0400)
tree9ca1c3652b4bf6a55a4334c1fd22aa082e6fa15f
parent77b0762eb81a53b79c53e6b0c6168a26a6cc87c7
sympy.interactive -- rework init_printing to support different stringifiers

This allows us to hook different printing functions as display_hook.

At present init_session supports:

o pprint    (isympy -p UNICODE | ASCII | any)
o sstrrepr  (isympy -p no)

an example which speaks for itself for `isympy -p no`:

In [1]: x**2
Out[1]: x**2

In [2]: set(['abc', 1, x, x**2, x**3, x**4, y, x**5])
Out[2]: set(['abc', 1, x, y, x**2, x**3, x**4, x**5])

i.e. everything works like in usual Python session without pprint, but
containers are printed with human-friendly / hash-stable ordering.

we'll reuse this property to robustify doctests in the next patch.

Signed-off-by: Kirill Smelkov <kirr@landau.phys.spbu.ru>
Signed-off-by: Ondrej Certik <ondrej@certik.cz>
sympy/interactive/__init__.py