Remove workaround for _dict_values (#6250)

The mypy issue was fixed
This commit is contained in:
Jelle Zijlstra
2021-11-07 15:13:05 -08:00
committed by GitHub
parent a88ae10186
commit 7c3c9d1a10
2 changed files with 4 additions and 8 deletions

View File

@@ -793,9 +793,7 @@ class _dict_keys(KeysView[_KT_co], Generic[_KT_co, _VT_co]):
if sys.version_info >= (3, 10):
mapping: MappingProxyType[_KT_co, _VT_co]
# The generics are the wrong way around because of a mypy limitation
# https://github.com/python/mypy/issues/11138
class _dict_values(ValuesView[_VT_co], Generic[_VT_co, _KT_co]):
class _dict_values(ValuesView[_VT_co], Generic[_KT_co, _VT_co]):
if sys.version_info >= (3, 10):
mapping: MappingProxyType[_KT_co, _VT_co]
@@ -828,7 +826,7 @@ class dict(MutableMapping[_KT, _VT], Generic[_KT, _VT]):
@overload
def update(self, **kwargs: _VT) -> None: ...
def keys(self) -> _dict_keys[_KT, _VT]: ...
def values(self) -> _dict_values[_VT, _KT]: ...
def values(self) -> _dict_values[_KT, _VT]: ...
def items(self) -> _dict_items[_KT, _VT]: ...
@classmethod
@overload

View File

@@ -244,9 +244,7 @@ class _OrderedDictKeysView(_dict_keys[_KT_co, _VT_co], Reversible[_KT_co]):
class _OrderedDictItemsView(_dict_items[_KT_co, _VT_co], Reversible[Tuple[_KT_co, _VT_co]]):
def __reversed__(self) -> Iterator[tuple[_KT_co, _VT_co]]: ...
# The generics are the wrong way around because of a mypy limitation
# https://github.com/python/mypy/issues/11138
class _OrderedDictValuesView(_dict_values[_VT_co, _KT_co], Reversible[_VT_co], Generic[_VT_co, _KT_co]):
class _OrderedDictValuesView(_dict_values[_KT_co, _VT_co], Reversible[_VT_co], Generic[_KT_co, _VT_co]):
def __reversed__(self) -> Iterator[_VT_co]: ...
class OrderedDict(Dict[_KT, _VT], Reversible[_KT], Generic[_KT, _VT]):
@@ -256,7 +254,7 @@ class OrderedDict(Dict[_KT, _VT], Reversible[_KT], Generic[_KT, _VT]):
def __reversed__(self) -> Iterator[_KT]: ...
def keys(self) -> _OrderedDictKeysView[_KT, _VT]: ...
def items(self) -> _OrderedDictItemsView[_KT, _VT]: ...
def values(self) -> _OrderedDictValuesView[_VT, _KT]: ...
def values(self) -> _OrderedDictValuesView[_KT, _VT]: ...
class defaultdict(Dict[_KT, _VT], Generic[_KT, _VT]):
default_factory: Callable[[], _VT] | None