Skip to content

Commit

Permalink
Make entry point collections (more) immutable.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Feb 15, 2021
1 parent 342a94b commit 00f10d9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions importlib_metadata/__init__.py
Expand Up @@ -157,8 +157,9 @@ def __reduce__(self):

class EntryPoints(tuple):
"""
A collection of EntryPoint objects, retrievable by name.
An immutable collection of EntryPoint objects, retrievable by name.
"""
__slots__ = ()

def __getitem__(self, name) -> EntryPoint:
try:
Expand All @@ -173,8 +174,9 @@ def names(self):

class GroupedEntryPoints(tuple):
"""
A collection of EntryPoint objects, retrievable by group.
An immutable collection of EntryPoint objects, retrievable by group.
"""
__slots__ = ()

def __getitem__(self, group) -> EntryPoints:
return EntryPoints(ep for ep in self if ep.group == group)
Expand Down

0 comments on commit 00f10d9

Please sign in to comment.