On Feb 21, 2013, at 6:13 AM, Johan Hake <[email protected]> wrote:

Thanks both of you!

Not sure I will be able to use Mul(..., evaluate=False) as I am executing
math code written in sympy. Having to rewrite the math using Mul would
clutter my code. When I try to turn of all evaluation by changing the
default argument to AssocOp to evaluate=False, I get recursion error when
printing some of the expressions.


That's doing too much. That will disable x*x => x**2 or even x - x => 0.


Also applying the fixes as suggested by the two commits in the branch
linked to in issue1497, did not do anything to the problem.


Just dig through Mul.flatten and figure out where it is happening. The code
is a little complicated, but it is well commented.

Aaron Meurer


It looks like it is a "feature" people want to get rid of, but it takes
some refactoring, as existing tests and code rely on it...

At least there is one more user which would benefit from it being removed :)

Johan

On Friday, February 15, 2013 6:54:59 AM UTC+1, Aaron Meurer wrote:
>
> Also take a look at
> http://code.google.com/p/sympy/issues/detail?id=1497. This is
> something that we would like to disable by default, but we haven't
> fixed it yet (it will require a bit of work, because a lot of code
> implicitly relies on this behavior).
>
> Aaron Meurer
>
> On Thu, Feb 14, 2013 at 7:38 PM, Chris Smith <[email protected]<javascript:>>
> wrote:
> > On Fri, Feb 15, 2013 at 3:35 AM, Johan Hake 
> > <[email protected]<javascript:>>
> wrote:
> >> Hello!
> >>
> >> First thanks for a wonderful toolkit!
> >>
> >> Second stupid questions and it might have been answered previously. Is
> it
> >> possible to not perform a scalar multiplication a la:
> >>
> >> from sympy import *
> >> s = Symbol("s")
> >> expr=(2.+s)*5
> >>
> >> without simplifying the expr to 5*s + 10.0?
> >>
> >> I use sympy to generate code and I would like the original expression
> >> instead of the simplified.
> >>
> >> Is this at all possible?
> >>
> >
> > You can use Mul(5, 2+s, evaluate=False).
> >
> > --
> > 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] <javascript:>.
> > To post to this group, send email to [email protected]<javascript:>.
>
> > Visit this group at http://groups.google.com/group/sympy?hl=en.
> > For more options, visit https://groups.google.com/groups/opt_out.
> >
> >
>
 --
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to