Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
aa3e69e5
Commit
aa3e69e5
authored
Dec 04, 2015
by
Brett Cannon
Browse files
Options
Browse Files
Download
Plain Diff
Merge for issue #23936
parents
65ca88e4
ccddbb18
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
19 deletions
+42
-19
Doc/glossary.rst
Doc/glossary.rst
+16
-6
Doc/library/sys.rst
Doc/library/sys.rst
+26
-13
No files found.
Doc/glossary.rst
View file @
aa3e69e5
...
@@ -308,10 +308,14 @@ Glossary
...
@@ -308,10 +308,14 @@ Glossary
A
synonym
for
:
term
:`
file
object
`.
A
synonym
for
:
term
:`
file
object
`.
finder
finder
An
object
that
tries
to
find
the
:
term
:`
loader
`
for
a
module
.
It
must
An
object
that
tries
to
find
the
:
term
:`
loader
`
for
a
module
that
is
implement
either
a
method
named
:
meth
:`
find_loader
`
or
a
method
named
being
imported
.
:
meth
:`
find_module
`.
See
:
pep
:`
302
`
and
:
pep
:`
420
`
for
details
and
:
class
:`
importlib
.
abc
.
Finder
`
for
an
:
term
:`
abstract
base
class
`.
Since
Python
3.3
,
there
are
two
types
of
finder
:
:
term
:`
meta
path
finders
<
meta
path
finder
>`
for
use
with
:
data
:`
sys
.
meta_path
`,
and
:
term
:`
path
entry
finders
<
path
entry
finder
>`
for
use
with
:
data
:`
sys
.
path_hooks
`.
See
:
pep
:`
302
`,
:
pep
:`
420
`
and
:
pep
:`
451
`
for
much
more
detail
.
floor
division
floor
division
Mathematical
division
that
rounds
down
to
nearest
integer
.
The
floor
Mathematical
division
that
rounds
down
to
nearest
integer
.
The
floor
...
@@ -593,10 +597,13 @@ Glossary
...
@@ -593,10 +597,13 @@ Glossary
:class:`collections.OrderedDict` and :class:`collections.Counter`.
:class:`collections.OrderedDict` and :class:`collections.Counter`.
meta path finder
meta path finder
A
finder
returned by a search of :data:`sys.meta_path`. Meta path
A
:term:`finder`
returned by a search of :data:`sys.meta_path`. Meta path
finders are related to, but different from :term:`path entry finders
finders are related to, but different from :term:`path entry finders
<path entry finder>`.
<path entry finder>`.
See :class:`importlib.abc.MetaPathFinder` for the methods that meta path
finders implement.
metaclass
metaclass
The class of a class. Class definitions create a class name, a class
The class of a class. Class definitions create a class name, a class
dictionary, and a list of base classes. The metaclass is responsible for
dictionary, and a list of base classes. The metaclass is responsible for
...
@@ -630,7 +637,7 @@ Glossary
...
@@ -630,7 +637,7 @@ Glossary
module spec
module spec
A namespace containing the import-related information used to load a
A namespace containing the import-related information used to load a
module.
module.
An instance of :class:`importlib.machinery.ModuleSpec`.
MRO
MRO
See :term:`method resolution order`.
See :term:`method resolution order`.
...
@@ -757,6 +764,9 @@ Glossary
...
@@ -757,6 +764,9 @@ Glossary
(
i
.
e
.
a
:
term
:`
path
entry
hook
`)
which
knows
how
to
locate
modules
given
(
i
.
e
.
a
:
term
:`
path
entry
hook
`)
which
knows
how
to
locate
modules
given
a
:
term
:`
path
entry
`.
a
:
term
:`
path
entry
`.
See
:
class
:`
importlib
.
abc
.
PathEntryFinder
`
for
the
methods
that
path
entry
finders
implement
.
path
entry
hook
path
entry
hook
A
callable
on
the
:
data
:`
sys
.
path_hook
`
list
which
returns
a
:
term
:`
path
A
callable
on
the
:
data
:`
sys
.
path_hook
`
list
which
returns
a
:
term
:`
path
entry
finder
`
if
it
knows
how
to
find
modules
on
a
specific
:
term
:`
path
entry
finder
`
if
it
knows
how
to
find
modules
on
a
specific
:
term
:`
path
...
...
Doc/library/sys.rst
View file @
aa3e69e5
...
@@ -779,19 +779,32 @@ always available.
...
@@ -779,19 +779,32 @@ always available.
.. data:: meta_path
.. data:: meta_path
A list of :term:`finder` objects that have their :meth:`find_module`
A list of :term:`meta path finder` objects that have their
methods called to see if one of the objects can find the module to be
:meth:`~importlib.abc.MetaPathFinder.find_spec` methods called to see if one
imported. The :meth:`find_module` method is called at least with the
of the objects can find the module to be imported. The
absolute name of the module being imported. If the module to be imported is
:meth:`~importlib.abc.MetaPathFinder.find_spec` method is called with at
contained in package then the parent package's :attr:`__path__` attribute
least the absolute name of the module being imported. If the module to be
is passed in as a second argument. The method returns ``None`` if
imported is contained in a package, then the parent package's :attr:`__path__`
the module cannot be found, else returns a :term:`loader`.
attribute is passed in as a second argument. The method returns a
:term:`module spec`, or ``None`` if the module cannot be found.
:data:`sys.meta_path` is searched before any implicit default finders or
:data:`sys.path`.
.. seealso::
See :pep:`302` for the original specification.
: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
.. data:: modules
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment