I am aware of the fact that class variables initialization happens at the time of the import. If that is the case, in the code below, does the class variable initialization of class A result in race conditions?
a.py:
class A:
# Static code here...
pass
b.py:
class B:
def func(self):
from a import A
c.py:
import threading
from b import B
b1 = B()
b2 = B()
t1 = threading.Thread(target=b1.func)
t2 = threading.Thread(target=b2.func)
t1.start()
t2.start()
t1.join()
t2.join()
Terminal:
$ python c.py