Use SupportsKeysAndGetItem in most Mapping constructors (#6626)

This commit is contained in:
Alex Waygood
2021-12-18 19:33:00 +00:00
committed by GitHub
parent ae725c3f10
commit 4f7f30a8c4
2 changed files with 8 additions and 5 deletions

View File

@@ -1,4 +1,5 @@
import sys
from _typeshed import SupportsKeysAndGetItem
from importlib.abc import _LoaderProtocol
from importlib.machinery import ModuleSpec
from typing import (
@@ -173,7 +174,7 @@ class CodeType:
@final
class MappingProxyType(Mapping[_KT, _VT_co], Generic[_KT, _VT_co]):
__hash__: None # type: ignore[assignment]
def __init__(self, mapping: Mapping[_KT, _VT_co]) -> None: ...
def __init__(self, mapping: SupportsKeysAndGetItem[_KT, _VT_co]) -> None: ...
def __getitem__(self, k: _KT) -> _VT_co: ...
def __iter__(self) -> Iterator[_KT]: ...
def __len__(self) -> int: ...