Improve types

This commit is contained in:
Edward Betts 2024-07-14 23:12:17 +08:00
parent 5c4eac60ee
commit 28ad4950fd

View file

@ -32,7 +32,7 @@ def next_launch_api_data(rocket_dir: str, limit: int = 200) -> StrDict | None:
return data return data
def next_launch_api(rocket_dir: str, limit: int = 200) -> list[Launch] | None: def next_launch_api(rocket_dir: str, limit: int = 200) -> list[Summary] | None:
"""Get the next upcoming launches from the API.""" """Get the next upcoming launches from the API."""
data = next_launch_api_data(rocket_dir, limit) data = next_launch_api_data(rocket_dir, limit)
if not data: if not data:
@ -158,7 +158,7 @@ def read_cached_launches(rocket_dir: str) -> list[Summary]:
def get_launches( def get_launches(
rocket_dir: str, limit: int = 200, refresh: bool = False rocket_dir: str, limit: int = 200, refresh: bool = False
) -> list[Summary]: ) -> list[Summary] | None:
"""Get rocket launches with caching.""" """Get rocket launches with caching."""
now = datetime.now() now = datetime.now()
existing = [ existing = [