diff --git a/importlib_metadata/__init__.py b/importlib_metadata/__init__.py index f9984697..312d6966 100644 --- a/importlib_metadata/__init__.py +++ b/importlib_metadata/__init__.py @@ -23,7 +23,6 @@ NullFinder, StrPath, install, - pypy_partial, ) from ._functools import method_cache, pass_none from ._itertools import always_iterable, unique_everseen @@ -128,34 +127,7 @@ def valid(line: str): return line and not line.startswith('#') -class DeprecatedTuple: - """ - Provide subscript item access for backward compatibility. - - >>> recwarn = getfixture('recwarn') - >>> ep = EntryPoint(name='name', value='value', group='group') - >>> ep[:] - ('name', 'value', 'group') - >>> ep[0] - 'name' - >>> len(recwarn) - 1 - """ - - # Do not remove prior to 2023-05-01 or Python 3.13 - _warn = functools.partial( - warnings.warn, - "EntryPoint tuple interface is deprecated. Access members by name.", - DeprecationWarning, - stacklevel=pypy_partial(2), - ) - - def __getitem__(self, item): - self._warn() - return self._key()[item] - - -class EntryPoint(DeprecatedTuple): +class EntryPoint: """An entry point as defined by Python packaging conventions. See `the packaging docs on entry points diff --git a/newsfragments/+9c754ffa.removal.rst b/newsfragments/+9c754ffa.removal.rst new file mode 100644 index 00000000..78e66eb9 --- /dev/null +++ b/newsfragments/+9c754ffa.removal.rst @@ -0,0 +1 @@ +Removed EntryPoint access by numeric index (tuple behavior). \ No newline at end of file