This is a more basic version of my previous question http://ask.sagemath.org/question/24696/preparsefalse-still-not-working/, which had distracting details.
Background:
In William Stein's Sage for Power Users (http://wstein.org/books/sagebook/sagebook.pdf), end of Section 2.2 and top of page 13, there is an example of how to turn the preparser off in the sage interpreter. The example works as claimed and here it is copied from my own computer:
| Sage Version 5.3, Release Date: 2012-09-08 | | Type "notebook()" for the browser-based notebook interface. |
| Type "help()" for help. |
sage: preparser(False) sage: 2/3 + 2^3 1 sage: preparser(True) sage: 2/3 + 2^3 26/3
Here is another example:
But now suppose that I want to put (almost) exactly the same lines into a .sage file called 'preparsertest.sage', close sage, reopen it, and then type attach('preparsertest.sage') into the interpreter. Naively I expect the same behaviour but that's not what I get.
Here is the content of 'preparsertest.sage':
preparser(False)
N=2/3 + 2^3
Here is the output from the interpreter:
sage: attach('preparsertest.sage') sage: N 26/3 sage: type(N) <type 'sage.rings.rational.rational'="">
So it seems that when I attach 'preparsertest.sage', the line preparser(False) is not being read.
What gives?