Skip to content

Commit 6c85b76

Browse files
committed
fix type PEP 484 prohibits implicit Optional
1 parent 7cf8fba commit 6c85b76

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎code/chapter03/ch03_synthetic_data_generation.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
OPENROUTER_TEACHER_MODEL = "anthropic/claude-sonnet-4.5" # same family, via OpenRouter
4141

4242

43-
def call_teacher(prompt: str, max_tokens: int = 4096, system: str = None) -> str:
43+
def call_teacher(prompt: str, max_tokens: int = 4096, system: str | None = None) -> str:
4444
"""Return the teacher LLM's raw text response to a prompt.
4545
4646
Default path: the Anthropic SDK directly, when ANTHROPIC_API_KEY is set -- this
@@ -287,7 +287,7 @@ def parse_candidates(raw_response: str, expected_label: str) -> list[dict]:
287287

288288
def generate_candidates(
289289
seeds: list[dict],
290-
categories: list[str] = None,
290+
categories: list[str] | None = None,
291291
n_per_cat: int = 30,
292292
) -> list[dict]:
293293
"""

0 commit comments

Comments
 (0)