Perhaps some things that could also useful for you: most symbolic functions can handle numpy arrays,
if you don't want to write map all the time perhaps you can do this: def theta_lazy(expression): try: return map(theta,expression) except TypeError: return theta(expression) regards, maldun On Jan 18, 1:14 pm, maldun <dom...@gmx.net> wrote: > Of course theta can't handle lists. > Try map instead: map(theta,[x,x^2,x^3]), because map applies the > function > to every list element. > > Hope this helps =) > maldun > > On Jan 14, 12:22 pm, Chris Swierczewski <cswie...@gmail.com> wrote: > > > Does anyone know of an example where a class __call__ method takes lists as > > input? (With possible symbolic entries, of course.) I'm attempting to follow > > the structure of Function_sec (and similar functions) but when I try > > > sage: var('x') > > sage: theta([x,x^2,x^3]) > > > I get the following error: > > > Traceback (click to the left of this block for traceback) > > ... > > TypeError: descriptor '__call__' requires a > > 'sage.symbolic.function.Function' object but received a 'list' > > > So for some reason my function isn't handling the symbolic input. Could > > somebody give some further guidance? Maybe a toy function that accepts > > vector input? > > > Thanks, > > > Chris -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org