Closed salimfadhley closed 2 years ago
Given this codee: @backoff.on_exception(wait_gen=backoff.expo, exception=requests.exceptions.HTTPError, max_tries=10)
@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]]"
Thanks. Fixed and released as backoff v2.2.1
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: