Use chained comparison in status codes for error and success
This commit is contained in:
parent
3451028251
commit
23f11aaa8d
@ -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"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user