Update mypy to 0.950 and fix complaints (#12650)
This commit is contained in:
@@ -85,12 +85,19 @@ class SortedDict(Dict[_KT, _VT]):
|
||||
def popitem(self, index: int = ...) -> Tuple[_KT, _VT]: ...
|
||||
def peekitem(self, index: int = ...) -> Tuple[_KT, _VT]: ...
|
||||
def setdefault(self, key: _KT, default: Optional[_VT] = ...) -> _VT: ...
|
||||
@overload
|
||||
def update(self, __map: Mapping[_KT, _VT], **kwargs: _VT) -> None: ...
|
||||
@overload
|
||||
def update(self, __iterable: Iterable[Tuple[_KT, _VT]], **kwargs: _VT) -> None: ...
|
||||
@overload
|
||||
def update(self, **kwargs: _VT) -> None: ...
|
||||
# Mypy now reports the first overload as an error, because typeshed widened the type
|
||||
# of `__map` to its internal `_typeshed.SupportsKeysAndGetItem` type in
|
||||
# https://github.com/python/typeshed/pull/6653
|
||||
# Since sorteddicts don't change the signature of `update` from that of `dict`, we
|
||||
# let the stubs for `update` inherit from the stubs for `dict`. (I suspect we could
|
||||
# do the same for many othe methods.) We leave the stubs commented to better track
|
||||
# how this file has evolved from the original stubs.
|
||||
# @overload
|
||||
# def update(self, __map: Mapping[_KT, _VT], **kwargs: _VT) -> None: ...
|
||||
# @overload
|
||||
# def update(self, __iterable: Iterable[Tuple[_KT, _VT]], **kwargs: _VT) -> None: ...
|
||||
# @overload
|
||||
# def update(self, **kwargs: _VT) -> None: ...
|
||||
def __reduce__(
|
||||
self,
|
||||
) -> Tuple[
|
||||
|
||||
Reference in New Issue
Block a user