Use chained comparison in status codes for error and success

This commit is contained in:
Saugat Pachhai 2019-08-17 14:25:34 +05:45 committed by Seth Michael Larson
parent 3451028251
commit 23f11aaa8d

View 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"