Typehint the parts of aiocache I'm using

This commit is contained in:
Danielle McLean 2023-11-27 15:48:18 +11:00
parent 06cae0fc0a
commit de884cbf72
Signed by: 00dani
GPG key ID: 52C059C3B22A753E
2 changed files with 9 additions and 0 deletions

View file

@ -0,0 +1 @@
from .factory import Cache as Cache

View file

@ -0,0 +1,8 @@
from typing import Generic, Optional, TypeVar
T = TypeVar('T')
class Cache(Generic[T]):
async def add(self, key: str, value: T, ttl: Optional[int]) -> None: ...
async def set(self, key: str, value: T, ttl: Optional[int]) -> None: ... # noqa: A003
async def get(self, key: str, default: T | None = None) -> T | None: ...