sympy/sympy — pull request #7239 by smichr (2014-03-08 07:57:18+00:00)
Title: fix Dummy.sort_key and use it in expr.sort_key

Also, catch any new Numbers that are generated by the rebuilding
of terms in Mul.flatten. Rather than check them at each step of
the way, just handle them once when done traversing the args.