Hi all,
I ran into the following unexpected behavior, which I assume is because
the preparser does not work with nested loads. I have two files,
foo.sage and bar.sage. Their contents are as follows:
foo.sage
--------
def foo():
return (-1)**(-1)
bar.sage
--------
load foo.sage
The following sage session works as expected:
sage: load foo.sage
sage: type(foo())
<type 'sage.rings.rational.Rational'>
The following session does not:
sage: load bar.sage
sage: type(foo())
<type 'float'>
I'm guessing that in the second session the file foo.sage is not getting
preparsed (and so foo() returns a Python object and not a Sage object).
Is this correct? If so, is there a way to force it to be preparsed? I
like to have lots of little files with different functions, and then a
file which loads whichever of these happen to be working/relevant at the
moment. That way I only have to load one file at the start of my session.
Any advice is much appreciated!
Thanks,
Jason Bandlow
--~--~---------~--~----~------------~-------~--~----~
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
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---