Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
base_request.py
andbase_response.py
were renamed torequest.py
andresponse.py
.BaseRequest
becameRequest
, andBaseResponse
becameResponse
. All mixin code was moved into the classes.__init__
.BaseRequest
andBaseResponse
can still be used inisinstance
andissubclass
, they will show a deprecation warning and actually check againstRequest
andResponse
.PlainRequest
is deprecated in favor of passingshallow=True
, since that's just as effective at preventing reading the input stream.Request
andResponse
.ETagResponseMixin
provided an overriddenfreeze
method, but it wasn't active on theResponse
class due to the inheritance order. It adds anETag
header if one is not already set. I kept/added this behavior during the merge, since it made about as much sense as setting theContent-Length
header. I also deprecated theno_etag
parameter (that wasn't visible inResponse
either), since I didn't see a clear reason to allow choosing this duringfreeze
and didn't want to open up the door to more such parameters iffreeze
is updated in the future.JSONMixin
and adapted it to be specific to request vs response behavior. Removed caching forresponse.get_json
(Cache Param For get_json() Leading to Contradictory Behavior #1698) as it caused issues if the data changed. Removed special exception handling for response. For some reason the mixin was written to usejson_module
, even though onlyloads
is called. I left it as-is because it avoids having to wrapstaticmethod(json.loads)
, and havingdumps
as well might be useful in the future. The request and response now havejson
,get_json
, and related methods by default.git blame
, git doesn't see thatresponse.py
was actuallybase_response.py
, and so the history doesn't look very interesting. Usinggit blame -M -C
will tell it to figure out that the file moved instead, so it correctly sees the history frombase_response.py
and the mixin modules (andwrappers.py
further back in history). PyCharm can also do this by selecting the "Detect movements across files" option when right clicking in the annotation sidebar.Checklist:
CHANGES.rst
summarizing the change and linking to the issue... versionchanged::
entries in any relevant code docs.pre-commit
hooks and fix any issues.pytest
andtox
, no tests failed.