-
Notifications
You must be signed in to change notification settings - Fork 61
Closed
Description
Test program:
import asyncio
from async_lru import alru_cache
@alru_cache(maxsize=16384)
async def my_cached_func(arg1: str, arg2: int) -> str:
return arg1 * arg2
async def main() -> None:
result = await my_cached_func("abc")
print(result)
asyncio.run(main())
Now, the program has a bug, but mypy normally can't find it because of missing type annotations:
# mypy test.py --ignore-missing-imports
If I comment out the @alru_cache(maxsize=16384)
line, I get the expected mypy error:
# mypy test.py --ignore-missing-imports
test.py:11: error: Too few arguments for "my_cached_func"
Relevant PEP: https://www.python.org/dev/peps/pep-0561/
Metadata
Metadata
Assignees
Labels
No labels