mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-10 05:51:52 +08:00
Make Mapping/MutableMapping params positional-only (#5772)
These are positional-only on dict, so it makes sense to mark them as positional-only in these base classes too. Fixes #5771
This commit is contained in:
@@ -41,9 +41,9 @@ class UserDict(MutableMapping[_KT, _VT]):
|
||||
def __delitem__(self, key: _KT) -> None: ...
|
||||
def __iter__(self) -> Iterator[_KT]: ...
|
||||
def __contains__(self, key: object) -> bool: ...
|
||||
def copy(self: _S) -> _S: ...
|
||||
def copy(self: Self) -> Self: ...
|
||||
@classmethod
|
||||
def fromkeys(cls: Type[_S], iterable: Iterable[_KT], value: _VT | None = ...) -> _S: ...
|
||||
def fromkeys(cls: Type[Self], iterable: Iterable[_KT], value: _VT | None = ...) -> Self: ...
|
||||
|
||||
class UserList(MutableSequence[_T]):
|
||||
data: list[_T]
|
||||
@@ -208,7 +208,7 @@ class Counter(Dict[_T, int], Generic[_T]):
|
||||
def __init__(self, __mapping: Mapping[_T, int]) -> None: ...
|
||||
@overload
|
||||
def __init__(self, __iterable: Iterable[_T]) -> None: ...
|
||||
def copy(self: _S) -> _S: ...
|
||||
def copy(self: Self) -> Self: ...
|
||||
def elements(self) -> Iterator[_T]: ...
|
||||
def most_common(self, n: int | None = ...) -> list[tuple[_T, int]]: ...
|
||||
@classmethod
|
||||
@@ -256,7 +256,7 @@ class _OrderedDictValuesView(dict_values[_KT_co, _VT_co], Reversible[_VT_co], Ge
|
||||
class OrderedDict(Dict[_KT, _VT], Reversible[_KT], Generic[_KT, _VT]):
|
||||
def popitem(self, last: bool = ...) -> tuple[_KT, _VT]: ...
|
||||
def move_to_end(self, key: _KT, last: bool = ...) -> None: ...
|
||||
def copy(self: _S) -> _S: ...
|
||||
def copy(self: Self) -> Self: ...
|
||||
def __reversed__(self) -> Iterator[_KT]: ...
|
||||
def keys(self) -> _OrderedDictKeysView[_KT, _VT]: ...
|
||||
def items(self) -> _OrderedDictItemsView[_KT, _VT]: ...
|
||||
@@ -296,3 +296,8 @@ class ChainMap(MutableMapping[_KT, _VT], Generic[_KT, _VT]):
|
||||
def __iter__(self) -> Iterator[_KT]: ...
|
||||
def __len__(self) -> int: ...
|
||||
def __missing__(self, key: _KT) -> _VT: ... # undocumented
|
||||
def setdefault(self, key: _KT, default: _VT = ...) -> _VT: ...
|
||||
@overload
|
||||
def pop(self, key: _KT) -> _VT: ...
|
||||
@overload
|
||||
def pop(self, key: _KT, default: _VT | _T = ...) -> _VT | _T: ...
|
||||
|
||||
Reference in New Issue
Block a user