From 23f11aaa8db466fd78eea2a812e35b008017d617 Mon Sep 17 00:00:00 2001 From: Saugat Pachhai Date: Sat, 17 Aug 2019 14:25:34 +0545 Subject: [PATCH] Use chained comparison in status codes for error and success --- httpx/status_codes.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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" -- 2.47.3