diff options
author | Brett Cannon <brett@python.org> | 2015-12-04 23:46:43 (GMT) |
---|---|---|
committer | Brett Cannon <brett@python.org> | 2015-12-04 23:46:43 (GMT) |
commit | aa3e69e57f7a23b90d1ed121f6e5946e4b2c52bc (patch) | |
tree | 4e09cfeee67cd20322b38362965d6bb4eb9617fa /Doc/library/sys.rst | |
parent | 65ca88e4e0b3d26e625d1aecd7c0fe0beb5e3b1d (diff) | |
parent | ccddbb186bcaec77f52a8c37d8b3f56de4b871dd (diff) | |
download | cpython-aa3e69e57f7a23b90d1ed121f6e5946e4b2c52bc.zip cpython-aa3e69e57f7a23b90d1ed121f6e5946e4b2c52bc.tar.gz cpython-aa3e69e57f7a23b90d1ed121f6e5946e4b2c52bc.tar.bz2 |
Merge for issue #23936
Diffstat (limited to 'Doc/library/sys.rst')
-rw-r--r-- | Doc/library/sys.rst | 39 |
1 files changed, 26 insertions, 13 deletions
diff --git a/Doc/library/sys.rst b/Doc/library/sys.rst index 97b5899..34947f8 100644 --- a/Doc/library/sys.rst +++ b/Doc/library/sys.rst @@ -779,19 +779,32 @@ always available. .. data:: meta_path - A list of :term:`finder` objects that have their :meth:`find_module` - methods called to see if one of the objects can find the module to be - imported. The :meth:`find_module` method is called at least with the - absolute name of the module being imported. If the module to be imported is - contained in package then the parent package's :attr:`__path__` attribute - is passed in as a second argument. The method returns ``None`` if - the module cannot be found, else returns a :term:`loader`. - - :data:`sys.meta_path` is searched before any implicit default finders or - :data:`sys.path`. - - See :pep:`302` for the original specification. - + A list of :term:`meta path finder` objects that have their + :meth:`~importlib.abc.MetaPathFinder.find_spec` methods called to see if one + of the objects can find the module to be imported. The + :meth:`~importlib.abc.MetaPathFinder.find_spec` method is called with at + least the absolute name of the module being imported. If the module to be + imported is contained in a package, then the parent package's :attr:`__path__` + attribute is passed in as a second argument. The method returns a + :term:`module spec`, or ``None`` if the module cannot be found. + + .. seealso:: + + :class:`importlib.abc.MetaPathFinder` + The abstract base class defining the interface of finder objects on + :data:`meta_path`. + :class:`importlib.machinery.ModuleSpec` + The concrete class which + :meth:`~importlib.abc.MetaPathFinder.find_spec` should return + instances of. + + .. versionchanged:: 3.4 + + :term:`Module specs <module spec>` were introduced in Python 3.4, by + :pep:`451`. Earlier versions of Python looked for a method called + :meth:`~importlib.abc.MetaPathFinder.find_module`. + This is still called as a fallback if a :data:`meta_path` entry doesn't + have a :meth:`~importlib.abc.MetaPathFinder.find_spec` method. .. data:: modules |