On Mon, Jun 1, 2009 at 3:39 PM, Ryan Krauss <ryanli...@gmail.com> wrote: > So, when would just adding an args.reverse() breakdown: > > den3 = s**4*m1*m2+k*s**2*m2+Gc*k > args = list(den3.args) > args.sort(sympy.Basic._compare_pretty) > args.reverse() > > seems to produce the ordering that I want. Adding the reverse line to > str.py and latex.py _print_Add methods seems to work. But obviously this is > a hack.
yes, it's a hack, but otherwise that's the way. Now it should just look for the main variable (as you suggested), that the user specifies optionally, and sort it with respect to it. See sympy/core/basic.py:Basic._compare_pretty for an example how to do sort it. Ondrej --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sympy" group. To post to this group, send email to sympy@googlegroups.com To unsubscribe from this group, send email to sympy+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sympy?hl=en -~----------~----~----~----~------~----~------~--~---