I agree that the two call methods do not intersect (although you would have to 
do it a little different from what you have below).  It just seems to me that 
we are deceiving the user if they are using sum thinking it is Python's sum but 
it is really ours.  And then they would be surprised to find that what they 
though was Python's sum also does symbolic summation.  So I am actually 
convinced by now that the only way to proceed with this is to rename sum(), 
which actually isn't that hard of a change because sum() isn't a function that 
is used by any other sympy algorithms, except for one line in product().

Aaron Meurer

On Jan 9, 2011, at 4:03 AM, smichr wrote:

> 
> 
> On Jan 9, 8:08 am, "Aaron S. Meurer" <asmeu...@gmail.com> wrote:
>> I have started changing sum() to summation() (I am leaving Sum alone).
>> 
> Why don't we ask the larger python community (from which tomorrow's
> sympy users will likely come). tutor list would be a good place as
> might the educator's list. I can post the request if you like.
> 
> I like the ssum idea.
> 
> I was thinking about the sum() option having a dual nature: whatever
> python does to sum wouldn't change anything for us if we did something
> like:
> 
>    def sum(a, b):
>        from python import sum as pysum
>        if not isinstance(a, Basic): # or should it be Expr?
>            return pysum(a, b)
>        else:
>            return Sum(a, b).doit()
> 
> If that import is done at the top this isn't adding much overhead.
> What am I missing? When defining it as above way there is no worry
> about errors or anything else since those will be raised if bad imput
> was given.
> 
> Anything that is an iterable container that doesn't derive from Basic/
> Expr will automatically work. In the following example I show that
> python's sum will take sympy's Tuple:
> 
>>>> from __builtin__ import sum as pysum
>>>> pysum(Tuple(1, 2, 3))
>    6
> 
> Then what about changing integrate to integral so we have Sum/sum and
> Integral/integral?
> 
> /c

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

Reply via email to