Skip to content

Commit

Permalink
Update documentation on EntryPoints to reflect the new, preferred acc…
Browse files Browse the repository at this point in the history
…essors.
  • Loading branch information
jaraco committed Jan 23, 2021
1 parent eedd810 commit 105d1a9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/using.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,18 +67,18 @@ This package provides the following functionality via its public API.
Entry points
------------

The ``entry_points()`` function returns a dictionary of all entry points,
The ``entry_points()`` function returns a sequence of all entry points,
keyed by group. Entry points are represented by ``EntryPoint`` instances;
each ``EntryPoint`` has a ``.name``, ``.group``, and ``.value`` attributes and
a ``.load()`` method to resolve the value. There are also ``.module``,
``.attr``, and ``.extras`` attributes for getting the components of the
``.value`` attribute::

>>> eps = entry_points()
>>> list(eps)
>>> sorted(eps.groups)
['console_scripts', 'distutils.commands', 'distutils.setup_keywords', 'egg_info.writers', 'setuptools.installation']
>>> scripts = eps['console_scripts']
>>> wheel = [ep for ep in scripts if ep.name == 'wheel'][0]
>>> wheel = scripts['wheel']
>>> wheel
EntryPoint(name='wheel', value='wheel.cli:main', group='console_scripts')
>>> wheel.module
Expand Down

0 comments on commit 105d1a9

Please sign in to comment.