Bug description
The following typing aliases have been deprecated since Python 3.9.
We should replace them by their current recommended equivalents, which all support subscripting since Python 3.9:
- list
- dict
- collections.abc.Callable
- collections.abc.Sequence
- etc.
While it's still safe to use either variant for the moment, PEP 585 says:
The deprecated functionality may eventually be removed from the typing module. Removal will occur no sooner than Python 3.9’s end of life, scheduled for October 2025.
October 2025 is coming soon so it would be good to adapt sooner than later if we want to be compatible with future versions of Python.
For wav2vec2aligner, where we declare support for Python 3.8, we could use from __future__ import annotations to enable subscripting list[...] and dict[...].
Bug description
The following typing aliases have been deprecated since Python 3.9.
We should replace them by their current recommended equivalents, which all support subscripting since Python 3.9:
While it's still safe to use either variant for the moment, PEP 585 says:
October 2025 is coming soon so it would be good to adapt sooner than later if we want to be compatible with future versions of Python.
For wav2vec2aligner, where we declare support for Python 3.8, we could use
from __future__ import annotationsto enable subscriptinglist[...]anddict[...].