Pass mypy on loop_claude

This commit is contained in:
2026-09-29 15:47:41 +02:00
parent 099e9e19a5
commit 6e643cc87c
10 changed files with 18 additions and 17 deletions
+2 -2
View File
@@ -29,8 +29,8 @@ def project_model(name, paths) -> str | Stop:
models = read_models(saved)
if isinstance(models, Stop):
return models
if chosen := models.get(name):
return chosen
if saved_model := models.get(name):
return saved_model
chosen = ask_model(name, saved, paths.model_catalog)
if isinstance(chosen, Stop):
return chosen
+3 -2
View File
@@ -23,7 +23,8 @@ def read_premises(root) -> str | Stop:
def sections(text) -> dict[str, list[str]]:
blocks, fenced = [], False
blocks: list[tuple[str | None, list[str]]] = []
fenced = False
for line in text.splitlines():
fenced ^= line.startswith("```")
if not fenced and line.startswith("## "):
@@ -32,7 +33,7 @@ def sections(text) -> dict[str, list[str]]:
blocks.append((None, []))
elif blocks and line.strip():
blocks[-1][1].append(line)
found = {}
found: dict[str, list[str]] = {}
for name, body in blocks:
if name is not None:
found.setdefault(name, []).append("\n".join(body))