@bmispelon $ echo 'A = 1; print("A1"); from b import A; print("A2")' > a.py$ echo 'print("B1"); from a import A; print("B2"); A += 1' > b.py$ python -c 'from a import A; print(A)'A1B1B2A22I added several prints so that it's possible to tell what order code is executed, and changed import * to import A because I think it improves clarity without changing the behavior.The main program runsIt encounters an import of a so it starts executing the content of a.py in a newly created a moduleIt sets A.a=1 via the assignment statement in a.pyIt encounters an import of b so it starts executing the content of b.py in a newly created b moduleIt sets b.A=1 by from...importIt adds 1 to b.A so that b.A is now equal to 2Execution reaches the end of b.py so it returns to a.pya.py sets a.A to 2 by from...importExecution reaches the end of a.py so it returns to the main program.The main program sets __main__.A to 2 by from ...importThe value of A is printed (2)