mbeliaev/resp types#535
Conversation
Codecov Report
@@ Coverage Diff @@
## master #535 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 7 7
Lines 2378 2382 +4
=========================================
+ Hits 2378 2382 +4
Continue to review full report at Codecov.
|
3565faa to
cf4404e
Compare
| stream = False | ||
| passthrough: bool = False | ||
| content_type: Optional[str] = None | ||
| headers: Optional[Mapping[str, str]] = None |
There was a problem hiding this comment.
Could this also be the list of tuples? Or has that been normalized by this point.
headers=(('X-CSRF', 'random-string'), ('Content-Length', 4),)is the format I'm thinking of.
There was a problem hiding this comment.
@markstory
thing becomes a bit more complecated since we use HTTPHeaderDict
it has type:
class HTTPHeaderDict(MutableMapping[str, str]):, see
https://github.com/urllib3/urllib3/blob/e16beb210c03c6f5ce4e0908bddb6556442b6a37/src/urllib3/_collections.py#L211
then in our implementatino here, we extend it:
responses/responses/__init__.py
Line 407 in 2a049bd
and extend takes either HTTPHeaderDict, Mapping or Iterable:
https://github.com/urllib3/urllib3/blob/e16beb210c03c6f5ce4e0908bddb6556442b6a37/src/urllib3/_collections.py#L334
so, generally list of tuples should be supportes and standard dict as well
add type annotations to
Responseobjects.until do a full type migration we have to keep redundant definition in stub file