On Fri, Jul 5, 2013 at 11:12 AM, Amit Saha <[email protected]> wrote:
> Hello,
>
> Is is possible to force the order of terms in an expression to be
> reverse of the order as is chosen by default i.e.highest to lowest?
>
> For example:
>
>>>> expr=3 + x**2 + x
>>>> expr
> x**2 + x + 3
>
> Is there a method to store or even simply display expr as:
>
> 3 + x + x**2
>
> without resorting to any hackery?
It depends on the printer, but for str(), this is implemented in
sympy/printing/str.py, line 44 (_print_Add).
If you look on top, you will see:
_default_settings = {
"order": None,
"full_prec": "auto",
}
These should be possible to set by the user. But for some reason I
can't figure out what to use for "order" to change the ordering.
Summary: it should be possible, and if not, it should be quite easy to fix.
Ondrej
--
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.
For more options, visit https://groups.google.com/groups/opt_out.