Skip to content

Commit

Permalink
Type hint istr keys allowed in LooseHeaders (#3976)
Browse files Browse the repository at this point in the history
  • Loading branch information
scop authored and asvetlov committed Aug 15, 2019
1 parent c5a80c8 commit ec5aee7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGES/3976.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Accept istr keys in LooseHeaders type hints.
11 changes: 9 additions & 2 deletions aiohttp/typedefs.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@
Union,
)

from multidict import CIMultiDict, CIMultiDictProxy, MultiDict, MultiDictProxy
from multidict import (
CIMultiDict,
CIMultiDictProxy,
MultiDict,
MultiDictProxy,
istr,
)
from yarl import URL

DEFAULT_JSON_ENCODER = json.dumps
Expand All @@ -33,7 +39,8 @@
Byteish = Union[bytes, bytearray, memoryview]
JSONEncoder = Callable[[Any], str]
JSONDecoder = Callable[[str], Any]
LooseHeaders = Union[Mapping[str, str], _CIMultiDict, _CIMultiDictProxy]
LooseHeaders = Union[Mapping[Union[str, istr], str], _CIMultiDict,
_CIMultiDictProxy]
RawHeaders = Tuple[Tuple[bytes, bytes], ...]
StrOrURL = Union[str, URL]
LooseCookies = Union[Iterable[Tuple[str, 'BaseCookie[str]']],
Expand Down

0 comments on commit ec5aee7

Please sign in to comment.