gh-102215: importlib documentation cleanups

This commit is contained in:
Sam Morris 2023-05-06 03:40:19 +01:00 committed by GitHub
parent c84029179c
commit 4cd95dce0b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 10 deletions

View File

@ -1,11 +1,11 @@
.. _using: .. _using:
================================= ========================================================
Using :mod:`!importlib.metadata` :mod:`!importlib.metadata` -- Accessing package metadata
================================= ========================================================
.. module:: importlib.metadata .. module:: importlib.metadata
:synopsis: The implementation of the importlib metadata. :synopsis: Accessing package metadata
.. versionadded:: 3.8 .. versionadded:: 3.8
.. versionchanged:: 3.10 .. versionchanged:: 3.10
@ -13,7 +13,7 @@
**Source code:** :source:`Lib/importlib/metadata/__init__.py` **Source code:** :source:`Lib/importlib/metadata/__init__.py`
``importlib_metadata`` is a library that provides access to ``importlib.metadata`` is a library that provides access to
the metadata of an installed `Distribution Package <https://packaging.python.org/en/latest/glossary/#term-Distribution-Package>`_, the metadata of an installed `Distribution Package <https://packaging.python.org/en/latest/glossary/#term-Distribution-Package>`_,
such as its entry points such as its entry points
or its top-level names (`Import Package <https://packaging.python.org/en/latest/glossary/#term-Import-Package>`_\s, modules, if any). or its top-level names (`Import Package <https://packaging.python.org/en/latest/glossary/#term-Import-Package>`_\s, modules, if any).
@ -24,7 +24,7 @@ API`_ and `metadata API`_ of ``pkg_resources``. Along with
this package can eliminate the need to use the older and less efficient this package can eliminate the need to use the older and less efficient
``pkg_resources`` package. ``pkg_resources`` package.
``importlib_metadata`` operates on third-party *distribution packages* ``importlib.metadata`` operates on third-party *distribution packages*
installed into Python's ``site-packages`` directory via tools such as installed into Python's ``site-packages`` directory via tools such as
`pip <https://pypi.org/project/pip/>`_. `pip <https://pypi.org/project/pip/>`_.
Specifically, it works with distributions with discoverable Specifically, it works with distributions with discoverable
@ -368,7 +368,7 @@ system :ref:`finders <finders-and-loaders>`. To find a distribution package's m
``importlib.metadata`` queries the list of :term:`meta path finders <meta path finder>` on ``importlib.metadata`` queries the list of :term:`meta path finders <meta path finder>` on
:data:`sys.meta_path`. :data:`sys.meta_path`.
By default ``importlib_metadata`` installs a finder for distribution packages By default ``importlib.metadata`` installs a finder for distribution packages
found on the file system. found on the file system.
This finder doesn't actually find any *distributions*, This finder doesn't actually find any *distributions*,
but it can find their metadata. but it can find their metadata.

View File

@ -1,5 +1,5 @@
:mod:`importlib.resources` -- Resources :mod:`importlib.resources` -- Package resource reading, opening and access
--------------------------------------- --------------------------------------------------------------------------
.. module:: importlib.resources .. module:: importlib.resources
:synopsis: Package resource reading, opening, and access :synopsis: Package resource reading, opening, and access
@ -97,7 +97,7 @@ for example, a package and its resources can be imported from a zip file using
Deprecated functions Deprecated functions
-------------------- ^^^^^^^^^^^^^^^^^^^^
An older, deprecated set of functions is still available, but is An older, deprecated set of functions is still available, but is
scheduled for removal in a future version of Python. scheduled for removal in a future version of Python.