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 <ondrej.cer...@gmail.com> wrote:
> On Wed, Jul 3, 2013 at 11:15 AM, Aaron Meurer <asmeu...@gmail.com> 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 sympy+unsubscr...@googlegroups.com.
> To post to this group, send email to sympy@googlegroups.com.
> 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 sympy+unsubscr...@googlegroups.com.
To post to this group, send email to sympy@googlegroups.com.
Visit this group at http://groups.google.com/group/sympy.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to