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 yields a NameError saying that "global name 'D' is not defined". However if I comment out the creation of the D() instance, everything works fine.
Why does this happen?
Thanks