11 lines
304 B
Python
11 lines
304 B
Python
from __future__ import annotations
|
|
|
|
|
|
def classify_response(status: int) -> tuple[bool, bool]:
|
|
"""Return (ok, permanent_failure)."""
|
|
if 200 <= status < 300:
|
|
return True, False
|
|
if 400 <= status < 500 and status not in (408, 425, 429):
|
|
return False, True
|
|
return False, False
|