No, Add(x, y, z, t) is not just used for fast construction. Any algorithm that recurses through an expression tree and rebuilds things will rebuild an Add in that way, using expr.func(*expr.args).
Aaron Meurer On Wed, Jul 3, 2013 at 12:22 PM, Ondřej Čertík <[email protected]> wrote: > On Wed, Jul 3, 2013 at 11:15 AM, Aaron Meurer <[email protected]> wrote: >> I don't think it's so easy, because Add has *args. > > If you are talking about things like: > > In [2]: Add(x, x, x, y, x, x) > Out[2]: 5⋅x + y > > Then those are of course needed for fast construction many terms into > on Add, but this not really exposed to user's code and it is used > inside things like expand(). As such, we can provide a special static > method or function for doing the same. On the other hand, if you > write: > > x + x + x + y + x + x > > in Python, then Python itself will call Symbol.__add__ etc., so this > would work well with our new dispatch. > > -- > 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. > > -- 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.
