The order that an Add is printed in is determined by the printer. I
think the only way to override this is to subclass the printer you are
using and override _as_ordered_terms. See
http://docs.sympy.org/latest/modules/printing.html and
https://github.com/sympy/sympy/blob/e6fc53f27ee872b27bc79b96529fc4bf34d4f023/sympy/printing/printer.py#L264.

Aaron Meurer

On Sat, Nov 29, 2014 at 11:59 AM, Paul Royik <[email protected]> wrote:
> I want to rewrite Integral of 10x^7-xy+y/x+2x^5 as sum of integrals.
> Something like
>
> Int(10x^7-xy+y/x+2x^5) = Int(10x^7)-Int(xy)+Int(y/x)+Int(2x^5)
>
> But sympy makes its own ordering and outputs
>
> Int(10x^7-xy+y/x+2x^5) = Int(2x^5)+Int(10x^7)+Int(y/x)-Int(xy)
>
> Where can I override this behaviour if Int is my own class?
>
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/sympy.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sympy/ca91d6e0-54fb-416f-bdd5-4432a36ff976%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CAKgW%3D6JP6DH589H2J3OfTOxFt_zG%2BFv21egDemcjNCfntS0vLw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to