I dont want this . this i can do directly by str(sympify(expr))

My question was to distinguish "x+x+y" and 2*x+y (which i can do by
evaluate=False)
and equality identification of "x+x+y" and "x+y+x" (which fails if
evaluate=False)

anyways i am using that workaround which i posted in my previous mail.

On Fri, Nov 11, 2011 at 12:49 PM, Chris Smith <[email protected]> wrote:

> Something like this might work, then:
>
>    >>> from sympy.utilities.iterables import cart
>    >>> terms = [x, x+y, x-y]
>    >>> for e in cartes(terms, ["+","-"], terms):
>    ...  expr = ' '.join([str(x) for x in e])
>    ...  ans = S(expr)
>    ...  print expr,';',ans
>    ...
>    x - y + x - y ; 2*x - 2*y
>    x - y + x ; 2*x - y
>    x - y + x - 2*y ; 2*x - 3*y
>    x - y - x - y ; -2*y
>    x - y - x ; -y
>    x - y - x - 2*y ; -3*y
>    x + x - y ; 2*x - y
>    x + x ; 2*x
>    x + x - 2*y ; 2*x - 2*y
>    x - x - y ; -y
>    x - x ; 0
>    x - x - 2*y ; -2*y
>    x - 2*y + x - y ; 2*x - 3*y
>    x - 2*y + x ; 2*x - 2*y
>    x - 2*y + x - 2*y ; 2*x - 4*y
>    x - 2*y - x - y ; -3*y
>    x - 2*y - x ; -2*y
>    x - 2*y - x - 2*y ; -4*y
>
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/sympy?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sympy?hl=en.

Reply via email to