Fix various type hints

This commit is contained in:
2026-04-05 08:27:40 +08:00
parent 29dfc6c5a4
commit 674b0de3b2
36 changed files with 157 additions and 121 deletions
+4 -1
View File
@@ -21,6 +21,8 @@ This module should not import any other module from the application.
"""
import re
from typing_extensions import assert_type
def parse_query_keywords(q: str | None) -> list[str]:
"""Returns the query keywords by the query parameter.
@@ -35,7 +37,8 @@ def parse_query_keywords(q: str | None) -> list[str]:
return []
keywords: list[str] = []
while True:
m: re.Match
m: re.Match[str] | None
assert q is not None
m = re.match(r"\"([^\"]+)\"\s+(.+)$", q)
if m is not None:
keywords.append(m.group(1))