Autogenerated type safety parameterisation of all methods

This commit is contained in:
Ian Renton
2026-09-20 20:02:19 +01:00
parent 6037e742cc
commit 324dd1414b
132 changed files with 1228 additions and 706 deletions
+6 -2
View File
@@ -1,6 +1,10 @@
from __future__ import annotations
import threading
from datetime import timedelta
from typing import Any
from requests import Response
from requests_cache import CachedSession
from core.data_store import CACHE_DIR
@@ -14,7 +18,7 @@ class URLDataCache(CachedSession):
used across multiple threads, though note that URL lookups will block each other this way, so it is still better to
create one of these objects per thread if possible."""
def __init__(self, name):
def __init__(self, name: str) -> None:
super().__init__(
f"{CACHE_DIR}urls/{name}",
expire_after=timedelta(days=1),
@@ -22,6 +26,6 @@ class URLDataCache(CachedSession):
)
self._lock = threading.Lock()
def get(self, *args, **kwargs):
def get(self, *args: Any, **kwargs: Any) -> Response:
with self._lock:
return super().get(*args, **kwargs)