mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-23 19:41:51 +08:00
More precise overloads for get/pop methods (#10501)
Fixes #10293 Co-authored-by: AlexWaygood <alex.waygood@gmail.com>
This commit is contained in:
@@ -75,7 +75,9 @@ class WeakValueDictionary(MutableMapping[_KT, _VT]):
|
||||
@overload
|
||||
def pop(self, key: _KT) -> _VT: ...
|
||||
@overload
|
||||
def pop(self, key: _KT, default: _VT | _T = ...) -> _VT | _T: ...
|
||||
def pop(self, key: _KT, default: _VT) -> _VT: ...
|
||||
@overload
|
||||
def pop(self, key: _KT, default: _T) -> _VT | _T: ...
|
||||
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]: ...
|
||||
@@ -118,7 +120,9 @@ class WeakKeyDictionary(MutableMapping[_KT, _VT]):
|
||||
@overload
|
||||
def pop(self, key: _KT) -> _VT: ...
|
||||
@overload
|
||||
def pop(self, key: _KT, default: _VT | _T = ...) -> _VT | _T: ...
|
||||
def pop(self, key: _KT, default: _VT) -> _VT: ...
|
||||
@overload
|
||||
def pop(self, key: _KT, default: _T) -> _VT | _T: ...
|
||||
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