diff --git a/Doc/glossary.rst b/Doc/glossary.rst --- a/Doc/glossary.rst +++ b/Doc/glossary.rst @@ -132,6 +132,11 @@ the documentation for :ref:`function definitions ` and :ref:`class definitions ` for more about decorators. + default path importer + The :term:`meta path handler` that facilitates imports from + :data:`sys.path` and within path-based packages. Most imports happen + through this :term:`importer`. Also see :term:`import system`. + descriptor Any object which defines the methods :meth:`__get__`, :meth:`__set__`, or :meth:`__delete__`. When a class attribute is a descriptor, its special @@ -208,10 +213,7 @@ A synonym for :term:`file object`. finder - An object that tries to find the :term:`loader` for a module. It must - implement either a method named :meth:`find_loader` or a method named - :meth:`find_module`. See :pep:`302` for details and - :class:`importlib.abc.Finder` for an :term:`abstract base class`. + See :term:`import handler`. floor division Mathematical division that rounds down to nearest integer. The floor @@ -308,6 +310,10 @@ and interpreter environment which ships with the standard distribution of Python. + initialized package + A traditional :term:`package` that may execute Python code when first + imported, such as a directory containing an ``__init__.py`` file. + immutable An object with a fixed value. Immutable objects include numbers, strings and tuples. Such an object cannot be altered. A new object has to @@ -315,13 +321,28 @@ role in places where a constant hash value is needed, for example as a key in a dictionary. + import handler + An object that provides module loaders through one of the import handler + APIs. See :term:`meta path handler` and :term:`path entry handler`. + + import hook + A generic name for any of the various ways you can hook into the + :term:`import system`. + + import system + The collection of APIs, interpreter state, and libraries that together + provide the import functionality of Python. See the + ``import system reference``. + + .. XXX set the `import system reference` link correctly, + importing - The process by which Python code in one module is made available to - Python code in another module. + The process by which Python code in one :term:`module` is made available + to Python code in another module. Importing is carried out by the + :term:`import system`. importer - An object that both finds and loads a module; both a - :term:`finder` and :term:`loader` object. + See :term:`import hook`. interactive Python has an interactive interpreter which means you can enter @@ -431,10 +452,7 @@ processed. loader - An object that loads a module. It must define a method named - :meth:`load_module`. A loader is typically returned by a - :term:`finder`. See :pep:`302` for details and - :class:`importlib.abc.Loader` for an :term:`abstract base class`. + See :term:`module loader`. mapping A container object that supports arbitrary key lookups and implements the @@ -444,10 +462,15 @@ include :class:`dict`, :class:`collections.defaultdict`, :class:`collections.OrderedDict` and :class:`collections.Counter`. - meta path finder - A finder returned by a search of :data:`sys.meta_path`. Meta path - finders are related to, but different from :term:`path entry finders - `. + meta hook + See :term:`meta path handler`. + + meta path handler + An :term:`import handler` placed on :data:`sys.meta_path`. By default + the :term:`import system` searches all the meta path handlers looking + for the :term:`module loader` that it should use when importing a + :term:`module`. Normally the last meta path handler is the + :term:`default path importer`. metaclass The class of a class. Class definitions create a class name, a class @@ -478,6 +501,11 @@ have a namespace contain arbitrary Python objects. Modules are loaded into Python by the process of :term:`importing`. + module loader + An object that implements the :term:`import system`'s loader API for + generating a :term:`module` from a name. Module loaders are provided + by :term:`import handlers `. + MRO See :term:`method resolution order`. @@ -540,15 +568,22 @@ package A Python module which can contain submodules or recursively, subpackages. Technically, a package is any Python module with a - ``__path__`` attribute. + ``__path__`` attribute. See :term:`namespace package` and + :term:`initialized package`. - path importer - A built-in :term:`finder` / :term:`loader` that knows how to find and - load modules from path entries. + path entry handler + An :term:`import handler` provided by a :term:`path hook`. The + :term:`default path importer` uses path entry handlers to get + :term:`module loaders ` for path-based modules. + + path hook + A callable object placed in :data:`sys.path_hooks`. The :term:`default + path importer` uses path hooks to find the right :term:`path entry + handler` for each of the paths in :data:`sys.path`. portion - A set of files in a single directory (possibly stored in a zip file) - that contribute to a namespace package, as defined in :pep:`420`. + A set of files in a single location (possibly stored in a zip file) + that contribute to a :term:`namespace package`, as defined in :pep:`420`. positional argument The arguments assigned to local names inside a function or method, @@ -626,10 +661,6 @@ :func:`~sys.getrefcount` function that programmers can call to return the reference count for a particular object. - initialized package - A traditional :term:`package` that may execute Python code when first - imported, such as a directory containing an ``__init__.py`` file. - __slots__ A declaration inside a class that saves memory by pre-declaring space for instance attributes and eliminating instance dictionaries. Though @@ -672,12 +703,6 @@ :meth:`~collections.somenamedtuple._asdict`. Examples of struct sequences include :data:`sys.float_info` and the return value of :func:`os.stat`. - path entry finder - A finder returned by a search of :data:`sys.path` or a package - ``__path__`` attribute by the :term:`path importer`. Path entry - finders are related to, but different from - :term:`meta path finders `. - triple-quoted string A string which is bound by three instances of either a quotation mark (") or an apostrophe ('). While they don't provide any functionality