add type hint for dict.CaseInsensitiveDict

This commit is contained in:
Prodesire 2018-02-17 13:16:35 +08:00
parent 3ffb75d062
commit 43c4dfb042
2 changed files with 9 additions and 1 deletions

View File

@ -67,7 +67,7 @@ class CaseInsensitiveDict(collections.MutableMapping):
behavior is undefined. behavior is undefined.
""" """
def __init__(self, data=None, **kwargs): def __init__(self, data=None, **kwargs):
self._store = dict() self._store = {}
if data is None: if data is None:
data = {} data = {}
self.update(data, **kwargs) self.update(data, **kwargs)

8
pydu/dict.pyi Normal file
View File

@ -0,0 +1,8 @@
import collections
from typing import Iterable, Tuple, Any, Optional
class CaseInsensitiveDict(collections.MutableMapping):
_store = ... # type: dict
def __init__(self, data: Optional(dict), **kwargs) -> None: ...
def lower_items(self) -> Iterable[Tuple[str, Any]]: ...