Skip to content

Commit

Permalink
Fix typing in StreamResponse ctor (aio-libs#3927)
Browse files Browse the repository at this point in the history
...by moving field type annotation to class definition
  • Loading branch information
AMDmi3 committed Aug 13, 2019
1 parent 3256c5c commit ba6aaf3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions aiohttp/web_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ class StreamResponse(BaseClass, HeadersMixin):
'_payload_writer', '_eof_sent', '_body_length', '_state',
'_headers', '_status', '_reason')

_headers: CIMultiDict[str]

def __init__(self, *,
status: int=200,
reason: Optional[str]=None,
Expand All @@ -84,9 +86,9 @@ def __init__(self, *,
self._state = {} # type: Dict[str, Any]

if headers is not None:
self._headers = CIMultiDict(headers) # type: CIMultiDict[str]
self._headers = CIMultiDict(headers)
else:
self._headers = CIMultiDict() # type: CIMultiDict[str]
self._headers = CIMultiDict()

self.set_status(status, reason)

Expand Down

0 comments on commit ba6aaf3

Please sign in to comment.