Skip to content

Commit 720362f

Browse files
committed
Update documentation on EntryPoints to reflect the new, preferred accessors.
1 parent eedd810 commit 720362f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

docs/using.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,18 +67,20 @@ This package provides the following functionality via its public API.
6767
Entry points
6868
------------
6969

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

7777
>>> eps = entry_points()
78-
>>> list(eps)
78+
>>> sorted(eps.groups)
7979
['console_scripts', 'distutils.commands', 'distutils.setup_keywords', 'egg_info.writers', 'setuptools.installation']
8080
>>> scripts = eps['console_scripts']
81-
>>> wheel = [ep for ep in scripts if ep.name == 'wheel'][0]
81+
>>> 'wheel' in scripts.names
82+
True
83+
>>> wheel = scripts['wheel']
8284
>>> wheel
8385
EntryPoint(name='wheel', value='wheel.cli:main', group='console_scripts')
8486
>>> wheel.module

0 commit comments

Comments
 (0)