On Sat, Jun 27, 2009 at 6:03 AM, Vinzent Steinberg<vinzent.steinb...@googlemail.com> wrote: > > On Jun 26, 11:29 am, Christophe <projet...@gmail.com> wrote: >> Hello, >> here is a simple code : >> ================ >> x = sympy.Symbol('x') >> a = sympy.Symbol('a') >> f = 'x**3+4*x+1/x+a' >> g = sympy.integrate(f,x) >> ================ >> The output put is "a*x + log(x) + 2*x**2 + x**4/4" . I think that it >> would be better to have the following output "a*x + 2*x**2 + x**4/4 + >> log(x)" . All polynomial expressions (regarding to letters) must be at >> the beginning. > > As far as I know the ordering in sympy depends only on hashes (and > thus depends on the platform). I agree with you that is should be at > least configurable to sort it having a nicer output.
Actually, only the order of .args depends on hashes, the way things are printed is controled in sympy/printing/str.py, method _print_Add(), which sorts the arguments by powers. It should also look for log() and pot it at the end, or at the beginning, I think puting it at the beginning looks better for me, but it may be configurable. > > If there is not yet an issue for this, it would be great if you create > one. :) Yes, even better if you try to fix the _print_Add() to handle "log" the way you want and attach a patch. :) 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 -~----------~----~----~----~------~----~------~--~---