> whose multiple settings files were importing from each other
You are not the only one who would be confused, please do not mention this in office hours
> whose multiple settings files were importing from each other
You are not the only one who would be confused, please do not mention this in office hours
@bmispelon Can you share the real-world motivation for this question at some point?
@bmispelon Here's my VSCodium session:
@bmispelon Then I ran c.py in a VS Codium debugger session, watching A.
- A starts as undefined (everything does).
- After the first line of a.py, A is 1, but I think that VS Codium is actually reporting a.A.
- The import in a is hit, and A goes to undefined. I think VSC is showing b.A.
- b's import runs, and A is 1. I think that's b.A.
- The second line of b is run, and A is 2.
- Execution goes back to c, where the value of A is 2.
@bmispelon My initial guess was 2. c first imports a.A, which is 1. But the call to import from a loads a.py. That includes the call to import * from b, which imports from a. So at that point, A is 1. b then adds one to A, which sets A at 2. Then execution returns to c, with A at 2. So I think the value of A in c comes from b.
I tried to verify this in a pdb session, but stepping through at a low enough level to see this was bringing me into even lower level Python functions.