Ask Your Question

Revision history [back]

This works for me from the command line. In the notebook, it fails the first time and succeeds the second time. Indeed, having a notebook cell containing

preparser(False)
type(2)

fails the first time I evaluate it and succeeds the second time. This is what is supposed to happen, though. Consider this, from the command-line:

sage: preparser(False); type(2)

The first thing that happens is that the whole line gets preparsed, so "2" gets turned into "Integer(2)". Then the line gets evaluated, so it turns the preparser off and it returns the type of "Integer(2)", namely sage.rings.integer.Integer. I think that the same thing happens in each cell of the notebook: the whole thing gets preparsed before any of it is evaluated. So you need to put preparser(False) in a separate cell and evaluate it first.