]> git.ipfire.org Git - thirdparty/httpx.git/commitdiff
Use chained comparison in status codes for error and success
authorSaugat Pachhai <suagatchhetri@outlook.com>
Sat, 17 Aug 2019 08:40:34 +0000 (14:25 +0545)
committerSeth Michael Larson <sethmichaellarson@gmail.com>
Sat, 17 Aug 2019 14:07:57 +0000 (09:07 -0500)
httpx/status_codes.py

index 5fe372995292c956f52ff8148a19fb08b7a18fd2..557b7584465e8f288db5ffd60301b64af694130d 100644 (file)
@@ -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"