I have a module i would like to import all the module recursively but module with from test import test_function
is not imported. If i modify any line in A.py or B.py it is reflecting but if i do any changes inside test_function it is not reflecting. Anyhelp or suggestion is highly appreciated
example
A.py
import B
def mainA():
pass
B.py
from test import test_function
def mainB():
test_function()
test.py
def test_function():
print("test function")
This is the recursive reload function
def rreload(self, module):
importlib.reload(module)
for attribute_name in dir(module):
attribute = getattr(module, attribute_name)
if type(attribute) is ModuleType:
rreload(attribute)
reload(sys.modules['A'])
question from:
https://stackoverflow.com/questions/66045645/recursive-reload-not-working-for-module-imported-with-from-test-import-test-func 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…