Fix signature of CaseInsensitiveDict (#1873)

The values can be more than just strings.
This commit is contained in:
David Euresti
2018-02-11 08:19:39 -08:00
committed by Jelle Zijlstra
parent c5bb3aa547
commit fe5e12795f

View File

@@ -1,9 +1,11 @@
from typing import Any, Iterator, MutableMapping, Text, Tuple, Union
from typing import Any, Iterator, MutableMapping, Tuple, TypeVar, Generic
class CaseInsensitiveDict(MutableMapping[str, Union[Text, bytes]]):
def lower_items(self) -> Iterator[Tuple[str, Union[Text, bytes]]]: ...
def __setitem__(self, key: str, value: Union[Text, bytes]) -> None: ...
def __getitem__(self, key: str) -> Union[Text, bytes]: ...
_VT = TypeVar('_VT')
class CaseInsensitiveDict(MutableMapping[str, _VT], Generic[_VT]):
def lower_items(self) -> Iterator[Tuple[str, _VT]]: ...
def __setitem__(self, key: str, value: _VT) -> None: ...
def __getitem__(self, key: str) -> _VT: ...
def __delitem__(self, key: str) -> None: ...
def __iter__(self) -> Iterator[str]: ...
def __len__(self) -> int: ...