I have a Python script which
- calls a function
foo
which imports and uses modulemy_module
- does some lengthy calculations
- calls a function
bar
which also imports and uses modulemy_module
If my_module.py
is changed at some point during step 2, will bar
always use the same my_module
that was used in foo
?
What if I run another Python script during step 2. that also imports my_module
?
I created the toy scenarios above, and it seems like my_module
indeed stays the same for all its calls in the original Pythons script, but I'd like to have a guarantee for that or know situations in which it could fail.
(Background: This is for scientific software development. I write an algorithm, commit to git, run it to see if it works and what it produces, and while waiting for it to finish continue working on its source. If I don't like the results, I'd like to know what exact source was responsible for the results.)