Maybe you want to use nested lambdas: map(lambda c: lambda f: Diff(f,c), coords)
On Wednesday, April 17, 2013 10:11:14 PM UTC+2, brombo wrote: > > Consider the following > > coords = symbols('x,y,z') > > I wish to contruct the list of functions: > > [Dx,Dy,Dx] > > where > > def Dx(f): > return(diff(f,coord[0])) > > etc. > > but I want to build the list [Dx,Dy,Dz] with a for loop and not have to > do a separate > > def Dx(f): > return(diff(f,coord[0])) > > def Dy(f): > return(diff(f,coord[1])) > > def Dz(f): > return(diff(f,coord[2])) > > since when I am writing the code I don't know how long coords will be. > -- 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?hl=en-US. For more options, visit https://groups.google.com/groups/opt_out.