mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 13:04:46 +08:00
28 lines
912 B
Python
28 lines
912 B
Python
import collections
|
|
from typing import Any, Generic, Iterable, Iterator, Mapping, Type, TypeVar, overload
|
|
|
|
_S = TypeVar("_S")
|
|
_KT = TypeVar("_KT")
|
|
_VT = TypeVar("_VT")
|
|
|
|
class frozendict(Mapping[_KT, _VT], Generic[_KT, _VT]):
|
|
|
|
dict_cls: Type[dict[Any, Any]] = ...
|
|
@overload
|
|
def __init__(self, **kwargs: _VT) -> None: ...
|
|
@overload
|
|
def __init__(self, mapping: Mapping[_KT, _VT]) -> None: ...
|
|
@overload
|
|
def __init__(self, iterable: Iterable[tuple[_KT, _VT]]) -> None: ...
|
|
def __getitem__(self, key: _KT) -> _VT: ...
|
|
def __contains__(self, key: object) -> bool: ...
|
|
def copy(self: _S, **add_or_replace: _VT) -> _S: ...
|
|
def __iter__(self) -> Iterator[_KT]: ...
|
|
def __len__(self) -> int: ...
|
|
def __repr__(self) -> str: ...
|
|
def __hash__(self) -> int: ...
|
|
|
|
class FrozenOrderedDict(frozendict[_KT, _VT]):
|
|
|
|
dict_cls: Type[collections.OrderedDict[Any, Any]] = ...
|