diff options
author | Brett Cannon <brett@python.org> | 2012-05-11 18:48:41 (GMT) |
---|---|---|
committer | Brett Cannon <brett@python.org> | 2012-05-11 18:48:41 (GMT) |
commit | c049952de76cbcd00e490e48445ed7a50d3dc83a (patch) | |
tree | 91d1ff6bffbb8d6c5b04a8bae6b53944eb078335 /Doc | |
parent | 0c59b039b86afa9f51c30f7d9f340d9c75984488 (diff) | |
download | cpython-c049952de76cbcd00e490e48445ed7a50d3dc83a.zip cpython-c049952de76cbcd00e490e48445ed7a50d3dc83a.tar.gz cpython-c049952de76cbcd00e490e48445ed7a50d3dc83a.tar.bz2 |
Issue #13959: Have
importlib.abc.FileLoader.load_module()/get_filename() and
importlib.machinery.ExtensionFileLoader.load_module() have their
single argument be optional as the loader's constructor has all the
ncessary information.
This allows for the deprecation of
imp.load_source()/load_compile()/load_package().
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/importlib.rst | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/Doc/library/importlib.rst b/Doc/library/importlib.rst index ddfaa21..cac5251 100644 --- a/Doc/library/importlib.rst +++ b/Doc/library/importlib.rst @@ -256,9 +256,14 @@ are also provided to help in implementing the core ABCs. Path to the file of the module. + .. method:: load_module(fullname=None) + + Calls + ``super().load_module(fullname if fullname is not None else self.name)``. + .. method:: get_filename(fullname) - Returns :attr:`path`. + Returns :attr:`path` when ``fullname`` equals :attr:`name` or ``None``. .. method:: get_data(path) @@ -638,10 +643,6 @@ find and load modules. Concrete implementation of :meth:`importlib.abc.SourceLoader.set_data`. - .. method:: load_module(fullname) - - Load the specified module if it is the same as :attr:`name`. - .. class:: SourcelessFileLoader(fullname, path) @@ -676,10 +677,6 @@ find and load modules. Returns ``None`` as bytecode files have no source when this loader is used. - .. method:: load_module(fullname) - - Loads the specified module if it is the same as :attr:`name`. - .. class:: ExtensionFileLoader(fullname, path) @@ -699,10 +696,10 @@ find and load modules. Path to the extension module. - .. method:: load_module(fullname) + .. method:: load_module(fullname=None) - Loads the extension module if and only if *fullname** is the same as - :attr:`name`. + Loads the extension module if and only if *fullname* is the same as + :attr:`name` or is ``None``. .. method:: is_package(fullname) |