Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
salimfadhley opened this issue Oct 5, 2022 · 1 comment
Closed

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

salimfadhley opened this issue Oct 5, 2022 · 1 comment

Comments

@salimfadhley
Copy link

salimfadhley commented Oct 5, 2022

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]]"
@bgreen-litl bgreen-litl changed the title 2.0 release gives type errors for previously valid usage? 2.2.0 release gives type errors for previously valid usage? Oct 5, 2022
@bgreen-litl
Copy link
Member

Thanks. Fixed and released as backoff v2.2.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants