On Sat, Oct 8, 2011 at 10:37 PM, Diego Mascialino
On Fri, Oct 7, 2011 at 8:04 PM, Cameron Simpson
wrote: Only when the traceback was being printed. You would need to stash the modtime at import for later reference.
Actually the source file modtime there is in the compiled source (.pyc). Import use this information to know if is necessary to compile the source again.
In my patch, when a traceback is going to be printed, I compare the actual modtime with the modtime stored in the pyc.
Having been caught by this myself on occasion, warning in the traceback certainly sounds like a reasonable hint to provide. I posted a comment to the tracker to that effect (also noting that even with this hint, reloading still has its own problems with stale references to previous incarnation of the module). Cheers, Nick. -- Nick Coghlan | ncoghlan@gmail.com | Brisbane, Australia