Description
Currently, eve/extended_typings re-exposes dict as Dict and other similar type classes.
|
if _sys.version_info >= (3, 9): |
|
# Standard library already supports PEP 585 (Type Hinting Generics In Standard Collections) |
|
from builtins import ( # type: ignore[assignment] |
|
dict as Dict, |
|
frozenset as FrozenSet, |
|
list as List, |
|
set as Set, |
|
tuple as Tuple, |
|
type as Type, |
|
) |
|
from collections import ( |
|
ChainMap as ChainMap, |
|
Counter as Counter, |
|
OrderedDict as OrderedDict, |
|
defaultdict as defaultdict, |
|
deque as deque, |
|
) |
|
from collections.abc import ( |
|
AsyncGenerator as AsyncGenerator, |
|
AsyncIterable as AsyncIterable, |
|
AsyncIterator as AsyncIterator, |
|
Awaitable as Awaitable, |
|
ByteString as ByteString, |
|
Callable as Callable, |
|
Collection as Collection, |
|
Container as Container, |
|
Coroutine as Coroutine, |
|
Generator as Generator, |
|
ItemsView as ItemsView, |
|
Iterable as Iterable, |
|
Iterator as Iterator, |
|
KeysView as KeysView, |
|
Mapping as Mapping, |
|
MappingView as MappingView, |
|
MutableMapping as MutableMapping, |
|
MutableSequence as MutableSequence, |
|
MutableSet as MutableSet, |
|
Reversible as Reversible, |
|
Sequence as Sequence, |
|
Set as AbstractSet, |
|
ValuesView as ValuesView, |
|
) |
|
from contextlib import ( |
|
AbstractAsyncContextManager as AsyncContextManager, |
|
AbstractContextManager as ContextManager, |
|
) |
|
from re import Match as Match, Pattern as Pattern |
While this was useful for earlier python versions, since python 3.10 type classes like dict are also generics and there's no need for Dict and friends anymore. We'd like to clean this up and use dict (and friends) over Dict (and friends), removing the re-export from eve/typings_extended.
This is a follow-up from discussion in PR #2093 (review).
/cc @egparedes as discussed, let's make this an issue rather than a TODO note in code.
Description
Currently,
eve/extended_typingsre-exposesdict as Dictand other similar type classes.gt4py/src/gt4py/eve/extended_typing.py
Lines 34 to 80 in 795977b
While this was useful for earlier python versions, since python 3.10 type classes like
dictare also generics and there's no need forDictand friends anymore. We'd like to clean this up and usedict(and friends) overDict(and friends), removing the re-export fromeve/typings_extended.This is a follow-up from discussion in PR #2093 (review).
/cc @egparedes as discussed, let's make this an issue rather than a TODO note in code.