1 | initial version |
It seems that 443 is not parsed properly in your first attempt (I don't really understand why; it might be a bug).
In any case, one way around that is the following:
sage: cmds = "def somef():\n return Integer(443r)\nres = somef()"
sage: sage_eval('res', cmds=cmds)
In your second attempt, both return 443
and res=somef()
are part of the definition of somef
, so that res
is not defined.