Skip to content

Commit bf777ae

Browse files
committed
Expand docs on EntryPoints
1 parent bb24370 commit bf777ae

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

importlib_metadata/__init__.py

+12
Original file line numberDiff line numberDiff line change
@@ -167,21 +167,33 @@ class EntryPoints(tuple):
167167
__slots__ = ()
168168

169169
def __getitem__(self, name): # -> EntryPoint:
170+
"""
171+
Get the EntryPoint in self matching name.
172+
"""
170173
try:
171174
return next(iter(self.select(name=name)))
172175
except StopIteration:
173176
raise KeyError(name)
174177

175178
def select(self, **params):
179+
"""
180+
Select entry points from self that match the
181+
given parameters (typically group and/or name).
182+
"""
176183
return EntryPoints(ep for ep in self if ep.matches(**params))
177184

178185
@property
179186
def names(self):
187+
"""
188+
Return the set of all names of all entry points.
189+
"""
180190
return set(ep.name for ep in self)
181191

182192
@property
183193
def groups(self):
184194
"""
195+
Return the set of all groups of all entry points.
196+
185197
For coverage while SelectableGroups is present.
186198
>>> EntryPoints().groups
187199
set()

0 commit comments

Comments
 (0)