diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2012-02-20 00:48:16 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2012-02-20 00:48:16 (GMT) |
commit | c541f8ef40634c379aab0e4537777203a910d355 (patch) | |
tree | 9b731dfbfc79f8c7ae11ec43d7f7914b4d32082b /Doc/library/importlib.rst | |
parent | 336b2f45e5c1212470b1b443a92d953f026b951e (diff) | |
download | cpython-c541f8ef40634c379aab0e4537777203a910d355.zip cpython-c541f8ef40634c379aab0e4537777203a910d355.tar.gz cpython-c541f8ef40634c379aab0e4537777203a910d355.tar.bz2 |
Issue #14043: Speed up importlib's _FileFinder by at least 8x, and add a new importlib.invalidate_caches() function.
importlib is now often faster than imp.find_module() at finding modules.
Diffstat (limited to 'Doc/library/importlib.rst')
-rw-r--r-- | Doc/library/importlib.rst | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Doc/library/importlib.rst b/Doc/library/importlib.rst index 6dd13cc..65b63c8 100644 --- a/Doc/library/importlib.rst +++ b/Doc/library/importlib.rst @@ -86,6 +86,14 @@ Functions that was imported (e.g. ``pkg.mod``), while :func:`__import__` returns the top-level package or module (e.g. ``pkg``). +.. function:: invalidate_caches() + + Invalidate importlib's internal caches. Calling this function may be + needed if some modules are installed while your program is running and + you expect the program to notice the changes. + + .. versionadded:: 3.3 + :mod:`importlib.abc` -- Abstract base classes related to import --------------------------------------------------------------- |