Typehint the parts of aiocache I'm using
This commit is contained in:
parent
06cae0fc0a
commit
de884cbf72
2 changed files with 9 additions and 0 deletions
1
stubs/aiocache/__init__.pyi
Normal file
1
stubs/aiocache/__init__.pyi
Normal file
|
@ -0,0 +1 @@
|
||||||
|
from .factory import Cache as Cache
|
8
stubs/aiocache/factory.pyi
Normal file
8
stubs/aiocache/factory.pyi
Normal 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: ...
|
Loading…
Reference in a new issue