fix: resolve typecheck errors in cache, atcoder, cses, and usaco
Problem: lua typecheck flagged missing start_time field on ContestSummary; ty flagged BeautifulSoup Tag/NavigableString union on csrf_input.get(), a 3-tuple unpack where _extract_problem_info now returns 4 values in cses.py, and an untyped list assignment in usaco.py. Solution: add start_time? to ContestSummary LuaDoc, guard csrf_input with hasattr check and type: ignore, unpack precision from _extract_problem_info in cses.py callers, and use cast() in usaco.py.
This commit is contained in:
parent
bad219e578
commit
de5a20c567
4 changed files with 17 additions and 8 deletions
|
|
@ -3,7 +3,7 @@
|
|||
import asyncio
|
||||
import json
|
||||
import re
|
||||
from typing import Any
|
||||
from typing import Any, cast
|
||||
|
||||
import httpx
|
||||
|
||||
|
|
@ -253,7 +253,7 @@ class USACOScraper(BaseScraper):
|
|||
"interactive": False,
|
||||
}
|
||||
|
||||
tests: list[TestCase] = info["tests"]
|
||||
tests = cast(list[TestCase], info["tests"])
|
||||
combined_input = "\n".join(t.input for t in tests) if tests else ""
|
||||
combined_expected = (
|
||||
"\n".join(t.expected for t in tests) if tests else ""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue