Lesson 053: Classes encapsulating mutable state
Focus
Compare against yesterday's mental model politely: Intermediate drills Classes encapsulating mutable state; spin token 476138 makes this page unlike its neighbours.
Key ideas
- Angle
Intermediate: micro cadence3mixesClasses encapsulating mutable state; spin10617. - Ritual: List two regressions CI should catch later.
- Guardrail: separate demo-trick from shipping discipline verbally.
Example (LESSON_UID = "intermediate-053")
# Intermediate drill L053 topic-5 micro-2 pattern-4
LESSON_UID = "intermediate-053"
spin_a, spin_b, spin_c = 740, 291, 268
score = 84
ladder = []
ladder.append("bronze" if score < (spin_a % 41 + 2) else "silver-ish")
ladder.append("gold" if score > (spin_b % 71 + 5) else "retry")
print(sorted(set(ladder)), score)
from pathlib import Path
import tempfile
with tempfile.TemporaryDirectory() as scratch:
target = Path(scratch) / "scratch-53.txt"
snap = [66, 812, 567, 322, 77]
target.write_text("\n".join(str(x) for x in snap), encoding="utf-8")
print("scratch_bytes", target.stat().st_size, "rolling", sum(snap) % (268 + 131))
Practice
Practice 13: Export checkpoints into bullets for teammate review. Literal nudge 13.
Fingerprints
- lesson_uid:
intermediate-053 - umbrella band:
Classes encapsulating mutable state(3/10) - lesson_index:
1679