This PR adds properties (is_2xx_successful, is_5xx_server_error, etc.) to the HTTP response class for easy classification of HTTP status codes, improving code readability.
Justification:
Improved readability: Using direct range comparisons like 100 <= self.status_code < 200 makes the code clear and intuitive.
Maintaining performance: The range comparison is efficient and keeps the performance trade-offs minimal while avoiding unnecessary complexity.
PR Description:
This PR adds properties (
is_2xx_successful
,is_5xx_server_error
, etc.) to the HTTP response class for easy classification of HTTP status codes, improving code readability.Justification:
100 <= self.status_code < 200
makes the code clear and intuitive.