summaryrefslogtreecommitdiffstats
path: root/Doc/library
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>2012-07-29 20:36:17 (GMT)
committerBarry Warsaw <barry@python.org>2012-07-29 20:36:17 (GMT)
commitd7d2194ea16005a2a58f8070bbfc2a24e068cb65 (patch)
tree7e5b45fad256b2ac9c38489db02b1ca14a5950f1 /Doc/library
parent96d97ec9c08a95201e9d7f0b7819ca6328002693 (diff)
downloadcpython-d7d2194ea16005a2a58f8070bbfc2a24e068cb65.zip
cpython-d7d2194ea16005a2a58f8070bbfc2a24e068cb65.tar.gz
cpython-d7d2194ea16005a2a58f8070bbfc2a24e068cb65.tar.bz2
Integration of importdocs from the features/pep-420 repo.
Diffstat (limited to 'Doc/library')
-rw-r--r--Doc/library/importlib.rst27
1 files changed, 21 insertions, 6 deletions
diff --git a/Doc/library/importlib.rst b/Doc/library/importlib.rst
index b114dd5..05b18d3 100644
--- a/Doc/library/importlib.rst
+++ b/Doc/library/importlib.rst
@@ -128,6 +128,16 @@ are also provided to help in implementing the core ABCs.
An abstract base class representing a :term:`finder`.
See :pep:`302` for the exact definition for a finder.
+ .. method:: find_loader(self, fullname):
+
+ An abstract method for finding a :term:`loader` for the specified
+ module. Returns a 2-tuple of ``(loader, portion)`` where portion is a
+ sequence of file system locations contributing to part of a namespace
+ package. The sequence may be empty. When present, `find_loader()` is
+ preferred over `find_module()`.
+
+ .. versionadded: 3.3
+
.. method:: find_module(fullname, path=None)
An abstract method for finding a :term:`loader` for the specified
@@ -190,6 +200,13 @@ are also provided to help in implementing the core ABCs.
(This is not set by the built-in import machinery,
but it should be set whenever a :term:`loader` is used.)
+ .. method:: module_repr(module)
+
+ An abstract method which when implemented calculates and returns the
+ given module's repr, as a string.
+
+ .. versionadded: 3.3
+
.. class:: ResourceLoader
@@ -270,14 +287,13 @@ are also provided to help in implementing the core ABCs.
Path to the file of the module.
- .. method:: load_module(fullname=None)
+ .. method:: load_module(fullname)
- Calls
- ``super().load_module(fullname if fullname is not None else self.name)``.
+ Calls super's ``load_module()``.
.. method:: get_filename(fullname)
- Returns :attr:`path` when ``fullname`` equals :attr:`name` or ``None``.
+ Returns :attr:`path`.
.. method:: get_data(path)
@@ -538,7 +554,6 @@ find and load modules.
.. versionadded:: 3.3
-
.. function:: all_suffixes()
Returns a combined list of strings representing all file suffixes for
@@ -727,7 +742,7 @@ find and load modules.
Path to the extension module.
- .. method:: load_module(fullname=None)
+ .. method:: load_module(fullname)
Loads the extension module if and only if *fullname* is the same as
:attr:`name` or is ``None``.