mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 04:54:47 +08:00
fix update method of WeakKeyDictionary and WeakValueDictionary (#13249)
This commit is contained in:
@@ -27,8 +27,6 @@ tkinter.simpledialog.[A-Z_]+
|
||||
tkinter.simpledialog.TclVersion
|
||||
tkinter.simpledialog.TkVersion
|
||||
tkinter.Text.count # stubtest somehow thinks that index1 parameter has a default value, but it doesn't in any of the overloads
|
||||
weakref.WeakKeyDictionary.update
|
||||
weakref.WeakValueDictionary.update
|
||||
|
||||
|
||||
# ===============================================================
|
||||
|
||||
@@ -115,6 +115,12 @@ class WeakValueDictionary(MutableMapping[_KT, _VT]):
|
||||
def pop(self, key: _KT, default: _VT) -> _VT: ...
|
||||
@overload
|
||||
def pop(self, key: _KT, default: _T) -> _VT | _T: ...
|
||||
@overload
|
||||
def update(self, other: SupportsKeysAndGetItem[_KT, _VT], /, **kwargs: _VT) -> None: ...
|
||||
@overload
|
||||
def update(self, other: Iterable[tuple[_KT, _VT]], /, **kwargs: _VT) -> None: ...
|
||||
@overload
|
||||
def update(self, other: None = None, /, **kwargs: _VT) -> None: ...
|
||||
if sys.version_info >= (3, 9):
|
||||
def __or__(self, other: Mapping[_T1, _T2]) -> WeakValueDictionary[_KT | _T1, _VT | _T2]: ...
|
||||
def __ror__(self, other: Mapping[_T1, _T2]) -> WeakValueDictionary[_KT | _T1, _VT | _T2]: ...
|
||||
@@ -163,6 +169,12 @@ class WeakKeyDictionary(MutableMapping[_KT, _VT]):
|
||||
def pop(self, key: _KT, default: _VT) -> _VT: ...
|
||||
@overload
|
||||
def pop(self, key: _KT, default: _T) -> _VT | _T: ...
|
||||
@overload
|
||||
def update(self, dict: SupportsKeysAndGetItem[_KT, _VT], /, **kwargs: _VT) -> None: ...
|
||||
@overload
|
||||
def update(self, dict: Iterable[tuple[_KT, _VT]], /, **kwargs: _VT) -> None: ...
|
||||
@overload
|
||||
def update(self, dict: None = None, /, **kwargs: _VT) -> None: ...
|
||||
if sys.version_info >= (3, 9):
|
||||
def __or__(self, other: Mapping[_T1, _T2]) -> WeakKeyDictionary[_KT | _T1, _VT | _T2]: ...
|
||||
def __ror__(self, other: Mapping[_T1, _T2]) -> WeakKeyDictionary[_KT | _T1, _VT | _T2]: ...
|
||||
|
||||
Reference in New Issue
Block a user