printing: let's pretty-sort dicts
commit41305ec3938aceb6a1f000100f2a9ef4664476bc
authorKirill Smelkov <kirr@landau.phys.spbu.ru>
Thu, 7 Aug 2008 20:02:52 +0000 (8 00:02 +0400)
committerKirill Smelkov <kirr@landau.phys.spbu.ru>
Thu, 7 Aug 2008 20:02:52 +0000 (8 00:02 +0400)
tree904c9d2eae276615590f13498e51e0e4b4eefd20
parente1e9f605f0f1fb4ea07130dda5fc74589cb95bc8
printing: let's pretty-sort dicts

Now Latex, Str and Pretty printers all first pretty-sort dicts by their keys
before printing. This brings two benefits:

1. the output is easier to read, e.g.

  ⎧               2       3       4    ⎫
  ⎨1: c₀, x: c₁, x : c₂, x : c₃, x : c₄⎬
  ⎩                                    ⎭

2. the output is stable wrt hash changes

Signed-off-by: Kirill Smelkov <kirr@landau.phys.spbu.ru>
Signed-off-by: Ondrej Certik <ondrej@certik.cz>
sympy/printing/latex.py
sympy/printing/pretty/pretty.py
sympy/printing/pretty/tests/test_pretty_unicode.py
sympy/printing/str.py
sympy/printing/tests/test_latex.py
sympy/printing/tests/test_str.py