On Wed, Jul 3, 2013 at 11:22 AM, 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.

So we just keep our Add unmodified in SymPy. That way, code like expand()
can still call Add(*terms). No problem.

If you want to override the behavior of expand(), then AddHold can
provide a different implementation of expand().

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.


Reply via email to