From: Saugat Pachhai Date: Sat, 17 Aug 2019 08:40:34 +0000 (+0545) Subject: Use chained comparison in status codes for error and success X-Git-Tag: 0.7.0~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=23f11aaa8db466fd78eea2a812e35b008017d617;p=thirdparty%2Fhttpx.git Use chained comparison in status codes for error and success --- diff --git a/httpx/status_codes.py b/httpx/status_codes.py index 5fe37299..557b7584 100644 --- a/httpx/status_codes.py +++ b/httpx/status_codes.py @@ -51,11 +51,11 @@ class StatusCode(IntEnum): @classmethod def is_client_error(cls, value: int) -> bool: - return value >= 400 and value <= 499 + return 400 <= value <= 499 @classmethod def is_server_error(cls, value: int) -> bool: - return value >= 500 and value <= 599 + return 500 <= value <= 599 # informational CONTINUE = 100, "Continue"