Nick Coghlan <ncogh...@gmail.com> added the comment:

I wasn't clear on what you meant by "potentially in the future".

Now that I realise you meant "Defer refreshing the bytecode cache to the next 
import attempt if `int(source_mtime) == int(time.time())`, but still bypass it 
for the current import", then yes, I agree that would reliably resolve the 
problem, since all imports during the same second as the edit would bypass the 
cache without updating it, and the first subsequent import would refresh it a 
timestamp that's guaranteed to be later than the source_mtime (not just equal).

Brett, what do you think? Such an adjustment to the caching logic should have 
next to no impact in the typical case where `int(source_mtime) < 
int(time.time())`, while still making it even less likely that hot reloaders 
will accidentally cache stale bytecode.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue31772>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to