Support keyword arguments for dict() (Python 2) (#148)

This commit is contained in:
Jukka Lehtosalo
2016-04-17 13:07:54 +01:00
parent 78e6e9b740
commit fcef262a9b

View File

@@ -514,12 +514,14 @@ class list(MutableSequence[_T], Generic[_T]):
def __le__(self, x: List[_T]) -> bool: ...
class dict(MutableMapping[_KT, _VT], Generic[_KT, _VT]):
# NOTE: Keyword arguments are special. If they are used, _KT must include
# str, but we have no way of enforcing it here.
@overload
def __init__(self) -> None: ...
def __init__(self, **kwargs: _VT) -> None: ...
@overload
def __init__(self, map: Mapping[_KT, _VT]) -> None: ...
def __init__(self, map: Mapping[_KT, _VT], **kwargs: _VT) -> None: ...
@overload
def __init__(self, iterable: Iterable[Tuple[_KT, _VT]]) -> None: ... # TODO keyword args
def __init__(self, iterable: Iterable[Tuple[_KT, _VT]], **kwargs: _VT) -> None: ...
def has_key(self, k: _KT) -> bool: ...
def clear(self) -> None: ...