As mentioned in Corley Brigman's commentary , this is unnecessary, but harmless.
For some background, the BaseResponse class was added during Kenneth's sprint in Requests 1.0. As a result of the 1.0 code change, transport adapters were introduced that allow you to define specific behavior for some HTTP endpoints (or truly non-HTTP endpoints ). An important part of the transport adapter interface is the HTTPAdapter.build_response() method, which returns the returned original response from HTTPAdapter.send() and creates a Response request from it.
Itβs clear that Kenneth saw potential utility in the form of an abstract base class for Response s, which would allow transport adapters to return Response with very different behavior to a standard HTTP Response object. For this reason, the refractor in ABC with most of the logic in the subclass seemed to make sense.
Later in the refactor, it again burst out as unnecessary complexity. The reality is that people who want to define specialized Response objects can simply subclass Response , instead of having an ABC that does nothing. This makes the main use case (vanilla queries) much cleaner in code and removes almost no utility.
When the BaseRequest class pulled out, this line was omitted, but since it does not cause any problems, it never needed to be deleted.
source share