Skip to content
Myr

Use chained comparison in status codes for error and success

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Saugat Pachhai · committed by Seth Michael Larson · parent 3451028 · Browse files · 1 file+2 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+2 added−2 removed

  • other:+2 added−2 removed

1 file+2 added−2 removed

modified:httpx/status_codes.py+2 added-2 removed
49 unmodified lines
50 )5152 @classmethod53 def is_client_error(cls, value: int) -> bool:54 return value >= 400 and value <= 49954 return 400 <= value <= 4995556 @classmethod57 def is_server_error(cls, value: int) -> bool:58 return value >= 500 and value <= 59958 return 500 <= value <= 5995960 # informational61 CONTINUE = 100, "Continue"62 SWITCHING_PROTOCOLS = 101, "Switching Protocols"
73 unmodified lines