On Mon, May 20, 2013 at 07:38:10PM +0800, P Purkayastha wrote:
> On 05/20/2013 07:08 PM, man...@gmx.net wrote:
> > A function
> >
> > def foo( ):
> >     return 0
> >
> > evaluates type( foo( ) ) to
> >
> > <type 'sage.rings.integer.Integer'>
> >
> > But then I put this function into bar.py like so
> >
> > bar.py:
> > from sage.all import *
> > def foo( ):
> >     return 0
> >
> > and
> >
> > import bar
> > type( bar.foo( ) )
> >
> > returns
> >
> > <type 'int'>
> >
> > Needless to say, this causes a bunch of new errors if my code assumes
> > that I get a sage type (I came across this because I did something like
> > real( ) on the result).
> >
> > Is this expected behaviour?
> >
> 
> How did you run bar.py? Rename it to bar.sage and then run it as
> 
> $ sage bar.sage

I did not "run" bar.py at all. As I described above I execute

---
import bar
type( bar.foo( ) )
---

from within SAGE (specifically, from within the Notebook)

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to