I have two python modules:
////funcs.py
from classes import * def func(): d = D() print "func" if __name__ == "__main__": c = C()
////classes.py
from funcs import * class C: def __init__(self): print "C class" func() class D: def __init__(self): print "D class"
Running funcs.py gives a NameError saying that the "global name" D "is not defined." However, if I comment on creating an instance of D (), everything will be fine.
Why is this happening?
thanks
source share