On Apr 21, 2011, at 01:47 , Simon King wrote: > Hi! > > On 21 Apr., 06:45, "Justin C. Walker" <[email protected]> wrote: >>> def test(p): >>> """ >>>>>> var('x') >>> x >>>>>> test(1/2*x) >>> 1/2*x >>> """ >>> print p >> ... >> >> You are using a ".py" file, so Sage treats it as python (not Sage) code. It >> doesn't get preparsed using Sage's rules. In particular, "a/b" is the >> integer quotient, not the rational numnber. > > Can that really be the reason? After all, there are a lot of Python > files in the Sage library.
Actually, there are *no* ".sage" files in the library. It's all .pyx and .py files. > I didn't test it You really should test it. Actual results are more convincing than hypothetical ones. However, there is a problem that I don't understand. Your example is not the OP's example. For some reason, his example includes lines with leading ">>>", which may cause some problems. I need to look at this more closely, but perhaps with more sleep under my belt :-} Justin -- Justin C. Walker, Curmudgeon at Large Institute for the Absorption of Federal Funds ----------- I'm beginning to like the cut of his jibberish. ----------- -- To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org
