mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-20 02:41:16 +08:00
Let MutableMapping.pop take a different default type. (#1044)
This is particularly useful for the idiom `d.pop(k, None)` to remove an item if it exists. Fixes #278
This commit is contained in:
committed by
Łukasz Langa
parent
d57bce361f
commit
2fdcd2e9e8
@@ -611,7 +611,6 @@ class dict(MutableMapping[_KT, _VT], Generic[_KT, _VT]):
|
||||
def __init__(self, iterable: Iterable[Tuple[_KT, _VT]], **kwargs: _VT) -> None: ...
|
||||
def clear(self) -> None: ...
|
||||
def copy(self) -> Dict[_KT, _VT]: ...
|
||||
def pop(self, k: _KT, default: _VT = None) -> _VT: ...
|
||||
def popitem(self) -> Tuple[_KT, _VT]: ...
|
||||
def setdefault(self, k: _KT, default: _VT = None) -> _VT: ...
|
||||
@overload
|
||||
|
||||
Reference in New Issue
Block a user