I have three files, with import statements done in the following way:
main.py
from file1 import *
from file2 import *
def someFunc():
print("hi")
file1.py
from main import someFunc as sayHi
class A:
def __init__(self):
pass
sayHi()
file2.py
from file1 import *
a = A()
As soon as that import line in file1.py is written, I get this error: ImportError: cannot import name someFunc
. And with another compiler, I get NameError: Name 'A' is not defined
. Why is this so?