Skip to content

Commit 37113c2

Browse files
committed
Removed EntryPoint access by numeric index (tuple behavior).
1 parent 84418f8 commit 37113c2

File tree

2 files changed

+2
-29
lines changed

2 files changed

+2
-29
lines changed

importlib_metadata/__init__.py

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
NullFinder,
2424
StrPath,
2525
install,
26-
pypy_partial,
2726
)
2827
from ._functools import method_cache, pass_none
2928
from ._itertools import always_iterable, unique_everseen
@@ -128,34 +127,7 @@ def valid(line: str):
128127
return line and not line.startswith('#')
129128

130129

131-
class DeprecatedTuple:
132-
"""
133-
Provide subscript item access for backward compatibility.
134-
135-
>>> recwarn = getfixture('recwarn')
136-
>>> ep = EntryPoint(name='name', value='value', group='group')
137-
>>> ep[:]
138-
('name', 'value', 'group')
139-
>>> ep[0]
140-
'name'
141-
>>> len(recwarn)
142-
1
143-
"""
144-
145-
# Do not remove prior to 2023-05-01 or Python 3.13
146-
_warn = functools.partial(
147-
warnings.warn,
148-
"EntryPoint tuple interface is deprecated. Access members by name.",
149-
DeprecationWarning,
150-
stacklevel=pypy_partial(2),
151-
)
152-
153-
def __getitem__(self, item):
154-
self._warn()
155-
return self._key()[item]
156-
157-
158-
class EntryPoint(DeprecatedTuple):
130+
class EntryPoint:
159131
"""An entry point as defined by Python packaging conventions.
160132
161133
See `the packaging docs on entry points
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Removed EntryPoint access by numeric index (tuple behavior).

0 commit comments

Comments
 (0)