D
Dun Peal
Hi!
Here's the demonstrating code:
# module foo.py
var = 0
def set():
global var
var = 1
Script using this module:
import foo
from foo import *
print var, foo.var
set()
print var, foo.var
Script output:
0 0
0 1
Apparently, the `var` we imported from `foo` never got set, but
`foo.var` on the imported `foo` - did. Why?
Thanks, D.
Here's the demonstrating code:
# module foo.py
var = 0
def set():
global var
var = 1
Script using this module:
import foo
from foo import *
print var, foo.var
set()
print var, foo.var
Script output:
0 0
0 1
Apparently, the `var` we imported from `foo` never got set, but
`foo.var` on the imported `foo` - did. Why?
Thanks, D.