On Tue, Jun 23, 2009 at 12:04 AM, Dan Drake<dr...@kaist.edu> wrote: > On Mon, 22 Jun 2009 at 10:00PM -0600, Ondrej Certik wrote: >> Sometimes if the code is very recursive, I use a hand made debugging >> printing using decorators --- I decorate each function I want to debug >> and it prints a nice tree like graph, so it's easy to check things, >> e.g: >> >> SYMPY_DEBUG=True ./bin/isympy >> >> In [1]: limit(sin(x)/x, x, 0) >> limitinf(_x*sin(1/_x), _x) = 1 >> +-mrv_leadterm(_x*sin(1/_x), _x) = (1, 0) >> | +-mrv(_x*sin(1/_x), _x) = set([_x]) >> | | +-mrv(_x, _x) = set([_x]) >> | | +-mrv(sin(1/_x), _x) = set([_x]) >> | | +-mrv(1/_x, _x) = set([_x]) >> | | +-mrv(_x, _x) = set([_x]) >> | +-mrv_leadterm(exp(_x)*sin(exp(-_x)), _x, set([exp(_x)])) = (1, 0) >> | +-rewrite(exp(_x)*sin(exp(-_x)), set([exp(_x)]), _x, _w) = >> (1/_w*sin(_w), -_x) >> | +-sign(_x, _x) = 1 >> | +-mrv_leadterm(1, _x) = (1, 0) >> +-sign(0, _x) = 0 >> +-limitinf(1, _x) = 1 > > Please share this code! I often am writing deeply recursive code and > it's so easy to get confused. I'd love to have the indentation > correspond to the call depth.
$SAGE_LOCAL/lib/python2.5/site-packages/sympy/series/gruntz.py the very first code starting after the module docstring. Ondrej --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to sage-devel-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---