redis / redis-py

Redis Python client
MIT License
12.57k stars 2.51k forks source link

Add missing type hints for `retry.py` #3250

Closed max-muoto closed 3 months ago

max-muoto commented 4 months ago

Pull Request check-list

Please make sure to review and check all of these items:

NOTE: these things are not required to open a PR and can be done afterwards / while the PR is open.

Description of change

Add missing type hints for the retry.py module.

max-muoto commented 4 months ago

@gerzse Comments should be addressed.

gerzse commented 3 months ago

@gerzse Comments should be addressed.

Thanks @max-muoto !

Getting picky now, but I run

mypy --python-version=3.8 redis/retry.py tests/test_retry.py tests/test_asyncio/test_retry.py

and it complains about BackoffMock class in the sync tests not being compatible with AbstractBackoff. Inheriting from AbstractBackoff, like in the async test should fix this.