Open pmirandaa opened 1 year ago
Here's an MRE
from asyncio import Lock
from asyncache import cached
from cachetools import LRUCache
@cached(cache=LRUCache(maxsize=640*1024, getsizeof=len), lock=Lock())
def get_pep(num):
...
vscode/pyright will error with:
error: Argument of type "Lock" cannot be assigned to parameter "lock" of type "AbstractContextManager[Any] | None" in function "cached"
Hi, reading your code I saw that you have the
lock
defined asAbstractContextManager
I think it should be
AbstractAsyncContextManager
because we can't doasync with lock
with something that is not async.