I'm not sure I agree that this is a bug.  After using the name "var"
in the loop, the value of var is y.  y is a symbolic variable, and
when evaluated at the string "x,y" it returns "x,y"; this seems like
desirable behavior (to have string-valued functions seems OK to me).

Or another way to put it: if the above behavior is a bug, then I think
the following would be as well:
sage: x,y = var("x,y")
sage: y(2)
2

Or perhaps I am missing something.
-M. Hampton

On May 9, 9:17 am, "William Stein" <[EMAIL PROTECTED]> wrote:
> On Fri, May 9, 2008 at 5:02 AM, Babai <[EMAIL PROTECTED]> wrote:
> > The RUN 2nd time:
>
> > x,y=var("x,y")
> > f(x,y)=sin(x)+cos(y)
> > grads=[diff(f,var) for var in (x,y)]
> > plot_vector_field(grads,[-5,5],[-5,5])
>
> > Result>>
> > Traceback (most recent call last):    grads=[diff(f,var) for var in
> > (x,y)]
> > ValueError: too many values to unpack
>
> > in SAGE Notebook
>
> > Then I reduce the run to:
>
> > x,y=var("x,y")
>
> > I get the result:
>
> > Traceback (most recent call last):
> >  File "<stdin>", line 1, in <module>
> >  File "/root/.sage/sage_notebook/worksheets/admin/6/code/6.py", line
> > 6, in <module>
> >    x,y=var("x,y")
> >  File "/root/sage-3.0.1-fc8-x86-i686-Linux/local/lib/python2.5/site-
> > packages/sympy/plotting/", line 1, in <module>
>
> > ValueError: too many values to unpack
>
> With the above clearer description I am able to replicate this and do consider
> it a subtle, serious, and interesting bug.  Thanks for the bug report
> and persisting
> in explaining it well!   We are now tracking this at
>
> http://trac.sagemath.org/sage_trac/ticket/3144
>
> William
>
> --
> William Stein
> Associate Professor of Mathematics
> University of Washingtonhttp://wstein.org
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to