Dear Group,

I tried to sum a finite set of elements, each consisting of a call to an undefined function:

import sympy
from sympy import *
k=symbols("k")
f=Function("f")
print("f(k)=",f(k))
print("sum=",sum(f(k),(0,k,10)))

This produced the following output:

f(k)= f(k)

Traceback (most recent call last):
  File "C:\SymPyProject\test.py", line 6, in <module>
    print("sum=",sum(f(k),(0,k,10)))

TypeError: 'f' object is not iterable

I would have expected to get:

f(0)+f(1)+f(2)+f(3)+f(4)+f(5)+f(6)+f(7)+f(8)+f(9)+f(10)

I'm using version 1.12rc1, but I'm 98% certain I got the same error with 1.11

Can anyone help?

David


--
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/85be61f1-c28f-99f4-17e2-d5588f5a8a6d%40dbailey.co.uk.

Reply via email to