Replace deprecated typing versions of standard collections
qstokkink opened this issue · 1 comments
qstokkink commented
The typing
versions of standard collections are deprecated since Python 3.9 (see https://docs.python.org/3/library/typing.html#deprecation-timeline-of-major-features) and these should be replaced with their actual class type:
tuple
instead oftyping.Tuple
list
instead oftyping.List
dict
instead oftyping.Dict
set
instead oftyping.Set
frozenset
instead oftyping.FrozenSet
type
instead oftyping.Type
contextlib.AbstractContextManager
instead oftyping.ContextManager
contextlib.AbstractAsyncContextManager
instead oftyping.AsyncContextManager
re.Pattern
instead oftyping.Pattern
andtyping.re.Pattern
re.Match
instead oftyping.Match
andtyping.re.Match
This substitution will require from __future__ import annotations
for older versions of Python.
I'll give this low priority, since no removal of these deprecated types is planned in any Python version yet.
qstokkink commented
set instead of typing.Set
This does not work with from __future__ import annotations
.