Lesson 107: functools.partial and caches
Focus
Slow tempo wins; narrate checkpoints aloud: Intermediate drills functools.partial and caches; spin token 884486 makes this page unlike its neighbours.
Key ideas
- Angle
Intermediate: micro cadence7mixesfunctools.partial and caches; spin85124. - Ritual: Describe falsifying evidence that would veto this pattern.
- Guardrail: name the surprise that triggered when literals shifted.
Example (LESSON_UID = "intermediate-107")
# Intermediate drill L107 topic-10 micro-6 pattern-4
LESSON_UID = "intermediate-107"
spin_a, spin_b, spin_c = 647, 217, 742
score = 96
ladder = []
ladder.append("bronze" if score < (spin_a % 41 + 6) else "silver-ish")
ladder.append("gold" if score > (spin_b % 71 + 10) else "retry")
print(sorted(set(ladder)), score)
from pathlib import Path
import tempfile
with tempfile.TemporaryDirectory() as scratch:
target = Path(scratch) / "scratch-107.txt"
snap = [120, 777, 443, 109, 766]
target.write_text("\n".join(str(x) for x in snap), encoding="utf-8")
print("scratch_bytes", target.stat().st_size, "rolling", sum(snap) % (742 + 131))
Practice
Practice 9: Inject a benign off-by-one, observe drift, revert with notes. Literal nudge 9.
Fingerprints
- lesson_uid:
intermediate-107 - umbrella band:
functools.partial and caches(7/10) - lesson_index:
3435