Le mardi 12 août 2014 03:25:35 UTC+2, Ivan Andrus a écrit : > > I’m not sure I understand. What do you mean when you say there is no > debugging? A recipe for what used to work and doesn’t now would be great. >
Wekk, for oe thng, you can't trace a call : [ In emacs ] sage: sage: def fact(n): ....: if(n==1):return(1) ....: else:return(n*fact(n-1)) ....: sage: trace("fact(3)") --------------------------------------------------------------------------- NotImplementedError Traceback (most recent call last) <ipython-input-20-a765fe6277a4> in <module>() ----> 1 trace("fact(3)") /usr/local/sage-6.3/local/lib/python2.7/site-packages/sage/misc/trace.pyc in trace(code, preparse) 74 from sage.plot.plot import EMBEDDED_MODE 75 if EMBEDDED_MODE: ---> 76 raise NotImplementedError("the trace command is not implemented in the Sage notebook; you must use the command line.") 77 78 from IPython.core.debugger import Pdb NotImplementedError: the trace command is not implemented in the Sage notebook; you must use the command line. This is the same message you get when attempting trace in the notebook. [ in command line ] sage: def fact(n): ....: if(n==1):return(1) ....: else:return(n*fact(n-1)) ....: sage: fact(3) 6 sage: trace("fact(3)") > <string>(1)<module>() ipdb> s --Call-- > <ipython-input-1-0a880cb62556>(1)fact() ----> 1 def fact(n): 2 if(n==Integer(1)):return(Integer(1)) 3 else:return(n*fact(n-Integer(1))) ipdb> s > <ipython-input-1-0a880cb62556>(2)fact() 1 def fact(n): ----> 2 if(n==Integer(1)):return(Integer(1)) 3 else:return(n*fact(n-Integer(1))) ipdb> s > <ipython-input-1-0a880cb62556>(3)fact() 2 if(n==Integer(1)):return(Integer(1)) ----> 3 else:return(n*fact(n-Integer(1))) 4 ipdb> s --Call-- > <ipython-input-1-0a880cb62556>(1)fact() ----> 1 def fact(n): 2 if(n==Integer(1)):return(Integer(1)) 3 else:return(n*fact(n-Integer(1))) ipdb> s > <ipython-input-1-0a880cb62556>(2)fact() 1 def fact(n): ----> 2 if(n==Integer(1)):return(Integer(1)) 3 else:return(n*fact(n-Integer(1))) ipdb> s > <ipython-input-1-0a880cb62556>(3)fact() 2 if(n==Integer(1)):return(Integer(1)) ----> 3 else:return(n*fact(n-Integer(1))) 4 ipdb> s --Call-- > <ipython-input-1-0a880cb62556>(1)fact() ----> 1 def fact(n): 2 if(n==Integer(1)):return(Integer(1)) 3 else:return(n*fact(n-Integer(1))) ipdb> s > <ipython-input-1-0a880cb62556>(2)fact() 1 def fact(n): ----> 2 if(n==Integer(1)):return(Integer(1)) 3 else:return(n*fact(n-Integer(1))) ipdb> s --Return-- 1 > <ipython-input-1-0a880cb62556>(2)fact() 1 def fact(n): ----> 2 if(n==Integer(1)):return(Integer(1)) 3 else:return(n*fact(n-Integer(1))) ipdb> s --Return-- 2 > <ipython-input-1-0a880cb62556>(3)fact() 2 if(n==Integer(1)):return(Integer(1)) ----> 3 else:return(n*fact(n-Integer(1))) 4 ipdb> s --Return-- 6 > <ipython-input-1-0a880cb62556>(3)fact() 2 if(n==Integer(1)):return(Integer(1)) ----> 3 else:return(n*fact(n-Integer(1))) 4 ipdb> s --Return-- None > <string>(1)<module>() ipdb> s > /usr/local/sage-6.3/local/lib/python/bdb.py(404)run() 403 finally: --> 404 self.quitting = 1 405 sys.settrace(None) ipdb> s sage: > I certainly didn’t intend to make things harder to debug, but maybe that’s > why EMBEDDED_MODE wasn’t used before. I like the interface a lot better > this way though. I guess I could change the plot functionality to > recognize EMACS_MODE or something. > It could be interesting to search if the reasons forbidding trace in the notebook are still valid. ut the notebook seem to be in "maintenance mode" according to various threads in sage-devel, and has no clear successor (a special mode of ipython-notebook ?Something like the SMC notebook ? Something else ?) , > > -Ivan > > On Aug 11, 2014, at 1:04 AM, Emmanuel Charpentier <emanuel.c...@gmail.com > <javascript:>> wrote: > > May I express a wish ? > > The current solution uses the same output mode as the notebook. This has a > somewhat serious drawback : no debugging... > > An alternative is to go through GUD to execute a "sageified" version of > pdb, as suggested by one of the discussions pointed to by the relevant > issue of the home site. But that introduces behaviour differences between > command line sage and sage under emacs. Not good... > > HTH, > > -- > Emmanuel Charpentier > > Le lundi 11 août 2014 05:11:34 UTC+2, Ivan Andrus a écrit : >> >> Thanks for reminding me. I released a new version of sage-mode >> (0.12—only the version number has changed), and opened >> http://trac.sagemath.org/ticket/16795 which needs review. I should have >> hurried to get it into 6.3 so that things weren’t broken. Sorry. >> >> -Ivan >> >> On Aug 8, 2014, at 4:12 PM, Emmanuel Charpentier <emanuel.c...@gmail.com> >> wrote: >> >> For future reference : >> >> Ivan Andrus did create a version of sage_mode that fixes the problem. It >> is currently available at the development site >> <https://bitbucket.org/gvol/sage-mode/downloads/sage_mode-20140730.spkg>, >> and not yet in the sage spkgs set. Works nicely for me (with sage 6.3rc0). >> >> HTH, >> >> -- >> Emmanuel Charpentier >> >> > -- > You received this message because you are subscribed to the Google Groups > "sage-support" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to sage-support...@googlegroups.com <javascript:>. > To post to this group, send email to sage-s...@googlegroups.com > <javascript:>. > Visit this group at http://groups.google.com/group/sage-support. > For more options, visit https://groups.google.com/d/optout. > > > -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at http://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout.