8000 Make entry point collections (more) immutable. · python/importlib_metadata@00f10d9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 00f10d9

Browse files
committed
Make entry point collections (more) immutable.
1 parent 342a94b commit 00f10d9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

importlib_metadata/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,9 @@ def __reduce__(self):
157157

158158
class EntryPoints(tuple):
159159
"""
160-
A collection of EntryPoint objects, retrievable by name.
160+
An immutable collection of EntryPoint objects, retrievable by name.
161161
"""
162+
__slots__ = ()
162163

163164
def __getitem__(self, name) -> EntryPoint:
164165
try:
@@ -173,8 +174,9 @@ def names(self):
173174

174175
class GroupedEntryPoints(tuple):
175176
"""
176-
A collection of EntryPoint objects, retrievable by group.
177+
An immutable collection of EntryPoint objects, retrievable by group.
177178
"""
179+
__slots__ = ()
178180

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

0 commit comments

Comments
 (0)
0