trace bug?

0 views
Skip to first unread message

Kurt

unread,
Jun 18, 2008, 4:44:34 AM6/18/08
to sage-devel
I have used the trace() function just fine in version 3.0.
It seems to have broken in 3.0.2, for example:

----------------------------------------------------------------------
| SAGE Version 3.0.2, Release Date: 2008-05-24 |
| Type notebook() for the GUI, and license() for information. |
----------------------------------------------------------------------

sage: trace('factor(100)')
> <string>(1)<module>()
(Pdb) s
NameError: "name 'factor' is not defined"
> <string>(1)<module>()
(Pdb)


In general, it seems that no symbol names (variables, functions, etc)
appear to be defined within the trace function.

I don't yet have 3.0.3 on my machine, so I don't know whether the
problem exists there or not.
I will be by on Wed. to load up 3.0.3 on my machine.

-- Kurt

Mike Hansen

unread,
Jun 18, 2008, 5:15:03 AM6/18/08
to sage-...@googlegroups.com
Hi Kurt,

We are tracking this issue here:
http://trac.sagemath.org/sage_trac/ticket/3345 . I posted a patch,
but it doesn't seem to fix all the issues. I'll try to take a look at
it again in the next few days if I can find soome time.

---Mike

William Stein

unread,
Jun 18, 2008, 5:32:30 AM6/18/08
to sage-...@googlegroups.com
On Wed, Jun 18, 2008 at 1:44 AM, Kurt <KWL...@gmail.com> wrote:
>

I can confirm that this is broken for me too in 3.0.2.
I don't know why -- we haven't changed trace in *years*.
Argh.

Any ideas?

william

Mike Hansen

unread,
Jun 18, 2008, 5:46:43 AM6/18/08
to sage-...@googlegroups.com
> I can confirm that this is broken for me too in 3.0.2.
> I don't know why -- we haven't changed trace in *years*.
> Argh.
>
> Any ideas?

It may be (and probably is) related to IPython 0.8.2 which went in in 3.0.2.

--Mike

mabshoff

unread,
Jun 18, 2008, 9:49:13 AM6/18/08
to sage-devel
I am very sure it is ipython related. You could verify by downgrading
the ipython.spkg.

We are tracking the bug at #3345 where Mike posted a patch, but that
does not seem to solve the issue 100%. There is now an ipython 0.8.4,
which might solve the problem.

> --Mike

Cheers,

Michael

Kurt

unread,
Aug 2, 2008, 4:55:22 PM8/2/08
to sage-devel
I notice that trac #3345 has been closed, which presumably means that
the new implementation of trace() is now pretty much functional.
(I say new implementation because it looks like something underlying
has changed; the prompt within trace changed from "(Pdb)" to "ipdb>",
which I assume is more than cosmetic.) Indeed, now I can do
trace("factor(100)") just fine. However, trace("7+4") does not seem
to do anything. If this is all that is lacking then I'm happy, since
I only intend to trace more substantial examples. I'm just curious
about what has really changed underneath.

-- Kurt

William Stein

unread,
Aug 2, 2008, 5:27:34 PM8/2/08
to sage-...@googlegroups.com
On Sat, Aug 2, 2008 at 1:55 PM, Kurt <KWL...@gmail.com> wrote:
>
> I notice that trac #3345 has been closed, which presumably means that
> the new implementation of trace() is now pretty much functional.
> (I say new implementation because it looks like something underlying
> has changed; the prompt within trace changed from "(Pdb)" to "ipdb>",
> which I assume is more than cosmetic.) Indeed, now I can do
> trace("factor(100)") just fine. However, trace("7+4") does not seem
> to do anything. If this is all that is lacking then I'm happy, since
> I only intend to trace more substantial examples. I'm just curious
> about what has really changed underneath.

The main change is that the input to trace is now a line of code rather than
an expression. So you should do

trace("print 7+4")

Of course you won't see much with that because 7+4 is done entirely in C.
Try

sage: var('x')
sage: trace('print x + x')

instead to see something, since for symbolic x right now x + x is done
in Python.

William

Reply all
Reply to author
Forward
0 new messages