On 07Oct2011 23:59, Michael Foord firstname.lastname@example.org wrote: | On 7 October 2011 20:53, Diego Mascialino email@example.com wrote: | > Hello, I opened this issue a long time ago, and Éric Araujo said that | > it should be discussed on this list. [...] | > The problem is that the source shown is updated, but the executed code | > is old, because it wasn't reloaded. | > | > Feature request: | > | > If the source code shown was modified after import time and it wasn't | > reloaded, a warning message should be shown. | > | > Example: | > | > Traceback (most recent call last): | > File "<stdin>", line 1, in <module> | > File "mod.py", line 2, in f WARNING: Modified after import! | > a,b,c = 1,2,3 | > ValueError: need more than 2 values to unpack | > | > or something like that. | > | | That would mean every function call would need to check the age of the | source file and bytecode file on disk and compare!
Only when the traceback was being printed. You would need to stash the modtime at import for later reference.