Lesson 076: Properties bridging fields and computation
Focus
Let the literals expose mistaken assumptions quickly: Intermediate drills Properties bridging fields and computation; spin token 659934 makes this page unlike its neighbours.
Key ideas
- Angle
Intermediate: micro cadence6mixesProperties bridging fields and computation; spin25579. - Ritual: Mirror the snippet with reversed iteration order verbally.
- Own one invariant tied to
Intermediate.
Example (LESSON_UID = "intermediate-076")
# Intermediate drill L076 topic-7 micro-5 pattern-11
LESSON_UID = "intermediate-076"
spin_a, spin_b, spin_c = 381, 920, 861
bucket = dict(seed=5 + spin_a)
def tweak(offset):
local = bucket["seed"]
bucket["seed"] = local + offset
return bucket["seed"]
print(tweak(8), tweak(12), bucket)
from pathlib import Path
import tempfile
with tempfile.TemporaryDirectory() as scratch:
target = Path(scratch) / "scratch-76.txt"
snap = [89, 479, 869, 268]
target.write_text("\n".join(str(x) for x in snap), encoding="utf-8")
print("scratch_bytes", target.stat().st_size, "rolling", sum(snap) % (861 + 131))
Practice
Practice 14: Shadow one variable purposely to spotlight scope quirks. Literal nudge 14.
Fingerprints
- lesson_uid:
intermediate-076 - umbrella band:
Properties bridging fields and computation(6/10) - lesson_index:
2436