diff options
author | Brett Cannon <brett@python.org> | 2012-02-27 23:15:42 (GMT) |
---|---|---|
committer | Brett Cannon <brett@python.org> | 2012-02-27 23:15:42 (GMT) |
commit | b46a1793a787747d59e735e12471b3a309aa51da (patch) | |
tree | 61eacabf46212791ef3fa96f44c95c9593c8607d /Doc/library | |
parent | 9a4d7ddb6c09af03953840ff8a2c1215fc6742a7 (diff) | |
download | cpython-b46a1793a787747d59e735e12471b3a309aa51da.zip cpython-b46a1793a787747d59e735e12471b3a309aa51da.tar.gz cpython-b46a1793a787747d59e735e12471b3a309aa51da.tar.bz2 |
Update importlib.invalidate_caches() to be more general.
Diffstat (limited to 'Doc/library')
-rw-r--r-- | Doc/library/importlib.rst | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/Doc/library/importlib.rst b/Doc/library/importlib.rst index 65b63c8..9a11e0b 100644 --- a/Doc/library/importlib.rst +++ b/Doc/library/importlib.rst @@ -88,9 +88,12 @@ Functions .. 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. + Invalidate the internal caches of the finders stored at + :data:`sys.path_importer_cache`. If a finder implements + :meth:`abc.Finder.invalidate_caches()` then it will be called to perform the + invalidation. 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 @@ -119,6 +122,12 @@ are also provided to help in implementing the core ABCs. be the value of :attr:`__path__` from the parent package. If a loader cannot be found, ``None`` is returned. + .. method:: invalidate_caches() + + An optional method which, when called, should invalidate any internal + cache used by the finder. Used by :func:`invalidate_caches()` when + invalidating the caches of all cached finders. + .. class:: Loader |