Skip to content

2.2.0 release gives type errors for previously valid usage? #177

Closed
@salimfadhley

Description

@salimfadhley

Given this codee:
@backoff.on_exception(wait_gen=backoff.expo, exception=requests.exceptions.HTTPError, max_tries=10)

We now get these validation errors from mypy:

11: error: Argument "wait_gen" to "on_exception" has incompatible type "Callable[[float, float, Optional[float]], Generator[Optional[float], Any, None]]"; expected "Callable[..., Generator[float, None, None]]"
10: error: Argument 1 to "on_exception" has incompatible type "Callable[[float, float, Optional[float]], Generator[Optional[float], Any, None]]"; expected "Callable[..., Generator[float, None, None]]"
11: error: Argument 1 to "on_exception" has incompatible type "Callable[[float, float, Optional[float]], Generator[Optional[float], Any, None]]"; expected "Callable[..., Generator[float, None, None]]"
11: error: Argument 1 to "on_exception" has incompatible type "Callable[[float, float, Optional[float]], Generator[Optional[float], Any, None]]"; expected "Callable[..., Generator[float, None, None]]"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions