mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 20:54:28 +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:
@@ -650,7 +650,9 @@ class MutableMapping(Mapping[_KT, _VT], Generic[_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: ...
|
||||
def popitem(self) -> tuple[_KT, _VT]: ...
|
||||
# This overload should be allowed only if the value type is compatible with None.
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user