Thanks very much for the bug report, this is a bug. Could you please
post here a simple use case where it fails, and/or possibly even a
patch fixing it?
We'll push it in if it looks good.
Thanks,
Ondrej
Thanks, that helps, here is the issue for it:
http://code.google.com/p/sympy/issues/detail?id=836
Ondrej
Friedrich also sent a patch to sympy-patches:
http://groups.google.com/group/sympy-patches/browse_thread/thread/78bf61123b3d7405
that fixes the problem by doing:
+ >>> lambdastr(3*x, [x,y,z])
+ 'lambda x,y,z: (3*x+0*y+0*z)'
my question is -- is it acceptable? I.e. do we want lambdify to return
stuff like 0*x? Is there some other way to fix the problem?
Ondrej
With the current revision from the mercurial repository you can do
[friedrich@wuschel:~] % isympy -q
Python 2.5.1 console for SymPy 0.5.14-hg
In [1]: F=lambdify(0,[x])
In [2]: F=vectorize(0)(F)
In [3]: from numpy import array
In [4]: F(array([0,1,2]))
Out[4]: [0, 0, 0]
The argument (0) in In[2] means that the first argument of the function F
is used for vectorizeing.
By,
Friedrich