no-async-function-cache
Standard library cache decorates a coroutine function and retains single-use coroutine objects.
Why
functools.cache, lru_cache, and cached_property store the coroutine object returned by an async function rather than its awaited value. A subsequent cache hit can raise RuntimeError: cannot reuse already awaited coroutine.
Fix
Remove the standard library cache or use an async-aware cache that stores completed results.
Examples
from functools import cache
@cacheasync def load() -> int: return 1async def load() -> int: return 1