mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-20 02:41:16 +08:00
Use overloading rather than Union for MutableMapping.update (#174)
See https://github.com/python/mypy/issues/1430 for motivation.
This commit is contained in:
committed by
Jukka Lehtosalo
parent
a5d5dcc4f4
commit
2b80cdf75e
@@ -179,8 +179,10 @@ class MutableMapping(Mapping[_KT, _VT], Generic[_KT, _VT]):
|
||||
def pop(self, k: _KT, default: _VT = ...) -> _VT: ...
|
||||
def popitem(self) -> Tuple[_KT, _VT]: ...
|
||||
def setdefault(self, k: _KT, default: _VT = ...) -> _VT: ...
|
||||
def update(self, m: Union[Mapping[_KT, _VT],
|
||||
Iterable[Tuple[_KT, _VT]]]) -> None: ...
|
||||
@overload
|
||||
def update(self, m: Mapping[_KT, _VT]) -> None: ...
|
||||
@overload
|
||||
def update(self, m: Iterable[Tuple[_KT, _VT]]) -> None: ...
|
||||
|
||||
Text = unicode
|
||||
|
||||
|
||||
Reference in New Issue
Block a user