Files
typeshed/stubs/frozendict/frozendict.pyi
Alex Waygood 96c9abb058 Always use _typeshed.Self, where applicable (#6880)
* Always use `_typeshed.Self`, where applicable

* Revert changes to `google-cloud-ndb` (ambiguous)

* Remove empty line added by script

* Revert changes to `stubs/python-dateutil/dateutil/relativedelta.pyi`

* Manually add a few more that the script missed

* Improve `filelock` annotation

Source code here: 79ec7b2826/src/filelock/_api.py (L207)

* Improve `opentracing/scope` annotation

Source code here: 3e1d357a34/opentracing/scope.py (L71)

* Improve `redis/client` stub

Source code here: 15f315a496/redis/client.py (L1217)

* Improve `redis/lock` annotation

Source code here: 15f315a496/redis/lock.py (L155)

* Improve `requests/models` annotation

Source code here: d718e75383/requests/models.py (L653)
2022-01-09 19:16:19 -08:00

28 lines
918 B
Python

import collections
from _typeshed import Self
from typing import Any, Generic, Iterable, Iterator, Mapping, TypeVar, overload
_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: Self, **add_or_replace: _VT) -> Self: ...
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]] = ...