[sage-devel] Re: Debugging personal code

2009-11-16 Thread William Stein
On Mon, Nov 16, 2009 at 8:22 AM, James Youngquist wrote: > > On November 15, 2009 10:54:16 pm William Stein wrote: >> On Sun, Nov 15, 2009 at 10:23 PM, kstueve wrote: >> > An alternative to adding/removing/commenting out/uncommenting print >> > statements through your code may be to use decorato

[sage-devel] Re: Debugging personal code

2009-11-16 Thread James Youngquist
On November 15, 2009 10:54:16 pm William Stein wrote: > On Sun, Nov 15, 2009 at 10:23 PM, kstueve wrote: > > An alternative to adding/removing/commenting out/uncommenting print > > statements through your code may be to use decorators. A decorator is > > a a function that is passed your function

[sage-devel] Re: Debugging personal code

2009-11-15 Thread William Stein
On Sun, Nov 15, 2009 at 10:59 PM, Nick Alexander wrote: > >> 4. I plan to implement a debugger like pdb in the notebook.  Something >> very similar has already been done by the Pylons project, which should >> give an idea of how to do it for Sage. > > This would be all kinds of awesome. I though

[sage-devel] Re: Debugging personal code

2009-11-15 Thread Nick Alexander
> 4. I plan to implement a debugger like pdb in the notebook. Something > very similar has already been done by the Pylons project, which should > give an idea of how to do it for Sage. This would be all kinds of awesome. If you are not familiar with the Smalltalk debugger, may I suggest you

[sage-devel] Re: Debugging personal code

2009-11-15 Thread William Stein
On Sun, Nov 15, 2009 at 10:23 PM, kstueve wrote: > > An alternative to adding/removing/commenting out/uncommenting print > statements through your code may be to use decorators.  A decorator is > a a function that is passed your function whenever it is called.  A > decorator can do whatever you w

[sage-devel] Re: Debugging personal code

2009-11-15 Thread William Stein
On Sun, Nov 15, 2009 at 9:08 PM, James Youngquist wrote: > > Hello, > >  I'm new at the whole python/sage thing.  Is there a better way to debug > pieces of code we're working on other than to insert print statements? > Something where we can step through the code a line at a time or generate > p

[sage-devel] Re: Debugging personal code

2009-11-15 Thread kstueve
An alternative to adding/removing/commenting out/uncommenting print statements through your code may be to use decorators. A decorator is a a function that is passed your function whenever it is called. A decorator can do whatever you want. Some of the possibilities are caching values of the fu

[sage-devel] Re: Debugging personal code

2009-11-15 Thread Nick Alexander
On 15-Nov-09, at 9:08 PM, James Youngquist wrote: > > Hello, > > I'm new at the whole python/sage thing. Is there a better way to > debug > pieces of code we're working on other than to insert print statements? > Something where we can step through the code a line at a time or > generate >