mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-10 05:51:52 +08:00
Use SupportsKeysAndGetItem in most Mapping constructors (#6626)
This commit is contained in:
@@ -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: ...
|
||||
|
||||
Reference in New Issue
Block a user