aioredis-py
                                
                                 aioredis-py copied to clipboard
                                
                                    aioredis-py copied to clipboard
                            
                            
                            
                        `aioredis.from_url()` is missing type annotation
Describe the bug
The function aioredis.from_url() is not type-annotated and that causes checks with mypy --strict to fail in user code.
To Reproduce
- Create a file (e.g. foo.py) containing the following:import aioredis redis = aioredis.from_url('redis://localhost')
- Check that file with mypy in strict mode (e.g. mypy --strict foo.py). That will cause the following error:error: Call to untyped function "from_url" in typed context.
Expected behavior
The expected behavior is to have mypy approving the example file in strict mode.
Logs/tracebacks
N/A
Python Version
$ python --version
Python 3.10.4
aioredis Version
$ python -m pip show aioredis
Name: aioredis
Version: 2.0.1
Summary: asyncio (PEP 3156) Redis support
Home-page: https://github.com/aio-libs/aioredis-py
Author:
Author-email:
License: MIT
Location: <prefix-removed-by-the-author>/venv/lib/python3.10/site-packages
Requires: async-timeout, typing-extensions
Required-by:
Additional context
No response
Code of Conduct
- [X] I agree to follow the aio-libs Code of Conduct
It looks like it's a few bytes fix... Changing
def from_url(url, **kwargs):
into
def from_url(url: str, **kwargs) -> Redis:
in the utils.py seem to do the job... in a project the only warnings were coming from this function and with the patch it's all fine.
Is there any reason for this to not be done while it looks really trivial?