New submission from Brett Cannon:

If you have enough control over your environment you really don't need to waste 
a stat call checking if the directory has been modified. That makes the idea of 
having the check of whether the directory has changed be exposed publicly a 
useful idea (code: 
http://hg.python.org/cpython/file/caf72b44240b/Lib/importlib/_bootstrap.py#l1387).

Maybe a check_mtime(old_mtime) where we guarantee that old_mtime is negative if 
this is the first check? That way the _path_mtime stays private but the check 
itself is exposed for people to do things like
``return 0`` so that the cache is built once on first use of find_loader() but 
otherwise never re-calculated.

----------
components: Library (Lib)
messages: 195898
nosy: brett.cannon
priority: normal
severity: normal
status: open
title: Expose mtime check in importlib.machinery.FileFinder
versions: Python 3.4

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

Reply via email to