mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 04:54:47 +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:
@@ -42,6 +42,11 @@ class WeakValueDictionary(MutableMapping[_KT, _VT]):
|
||||
def items(self) -> Iterator[tuple[_KT, _VT]]: ... # type: ignore
|
||||
def itervaluerefs(self) -> Iterator[KeyedRef[_KT, _VT]]: ...
|
||||
def valuerefs(self) -> list[KeyedRef[_KT, _VT]]: ...
|
||||
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: ...
|
||||
|
||||
class KeyedRef(ref[_T], Generic[_KT, _T]):
|
||||
key: _KT
|
||||
@@ -67,6 +72,11 @@ class WeakKeyDictionary(MutableMapping[_KT, _VT]):
|
||||
def values(self) -> Iterator[_VT]: ... # type: ignore
|
||||
def items(self) -> Iterator[tuple[_KT, _VT]]: ... # type: ignore
|
||||
def keyrefs(self) -> list[ref[_KT]]: ...
|
||||
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: ...
|
||||
|
||||
class finalize:
|
||||
def __init__(self, __obj: object, __func: Callable[..., Any], *args: Any, **kwargs: Any) -> None: ...
|
||||
|
||||
Reference in New Issue
Block a user