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.
I didn't test it, but shouldn't it work if the test is written with
the Sage prompt?
That's to say:
def test(p):
"""
TEST::
sage: var('x')
x
sage: test(1/2*x)
1/2*x
"""
print p
Best regards,
Simon
--
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