dear all

in documentation for var() it is stated "variables ... automatically
injected into the global namespace". I'd like to define variable in
module and then use it from several scripts, but variable is not
exported actually. my prog.sage looks like:

from mod import *
createVar('A')
f = A^2
print f

and module mod.py :

from sage.all import *
def createVar(s):
    return var(s)

it gives:

$ sage prog.sage
Traceback (most recent call last):
  File "prog.py", line 7, in <module>
    f = A**_sage_const_2
NameError: name 'A' is not defined

A is definitely not in global namespace. it only works correctly if I
change
from mod import *
to
attach mod.py

is it intended behavior?

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to