#4496: Plot doesn't allow variable outside tuple after lambda
----------------------+-----------------------------------------------------
 Reporter:  kcrisman  |       Owner:  was       
     Type:  defect    |      Status:  new       
 Priority:  major     |   Milestone:  sage-3.2.1
Component:  graphics  |    Keywords:            
----------------------+-----------------------------------------------------
 All of the following work fine in 3.2.alpha0:
 {{{
 sage: plot(lambda x: x,(x,-1,1))
 sage: plot(lambda x: x,-1,1)
 sage: plot(x,x,-1,1)
 sage: plot(x,-1,1)
 }}}
 But this doesn't:
 {{{
 sage: plot(lambda x: x,x,-1,1)
 verbose 0 (3400: plot.py, plot) there were 3 extra arguments (besides
 <function <lambda> at 0x11a22f70>)
 ---------------------------------------------------------------------------
 UnboundLocalError                         Traceback (most recent call
 last)
 <snip>
 .../sage-3.2.alpha0/local/lib/python2.5/site-packages/sage/plot/plot.pyc
 in plot(funcs, *args, **kwds)
    3601     if do_show:
    3602         G.show()
 -> 3603     return G
    3604
    3605 def _plot(funcs, xrange, parametric=False,

 UnboundLocalError: local variable 'G' referenced before assignment
 }}}
 Upon further examination, it seems that the culprit is that
 SymbolicVariable has a plot method, but lambda functions do not.  This is
 easy to fix, by changing plot() in plot.py to handle this, for the n==3
 args case.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/4496>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of 
Reinventing the Wheel
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to