Skip to content

RFC: Allow predicate value for status_forcelist #21

@mharrisb1

Description

@mharrisb1

Request for comment (RFC) on potential feature:

Allow predicate with signature Callable[[int], bool] to be used for status_forcelist.

This can allow a user to add range of status codes without explicitly enumerating them.

Example:

from httpx_retries import Retry

def is_5XX_status(code: int) -> bool:
    return code >= 500

rules = Retry(status_forcelist=is_5XX_status)

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueGood for newcomersquestionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions