fix update method of WeakKeyDictionary and WeakValueDictionary (#13249)

This commit is contained in:
Stephen Morton
2024-12-22 16:53:55 -08:00
committed by GitHub
parent d8b7ad6e89
commit ea91db2380
2 changed files with 12 additions and 2 deletions

View File

@@ -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
# ===============================================================

View File

@@ -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]: ...