Skip to content

Commit

Permalink
[3.6] Type hint istr keys allowed in LooseHeaders (#3976) (#3981)
Browse files Browse the repository at this point in the history
(cherry picked from commit ec5aee7)

Co-authored-by: Ville Skyttä <[email protected]>
  • Loading branch information
asvetlov and scop authored Aug 15, 2019
1 parent 9d290a7 commit d4f05dd
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 d4f05dd

Please sign in to comment.