Lesson 162: Reading text streams safely (StringIO warmup)
Focus
This page is deliberate repetition with new literals: Basic drills Reading text streams safely (StringIO warmup); spin token 1381157 makes this page unlike its neighbours.
Key ideas
- Angle
Basic: micro cadence2mixesReading text streams safely (StringIO warmup); spin61989. - Ritual: Swap one benign literal twice to see binding effects.
- Guardrail: name the surprise that triggered when literals shifted.
Example (LESSON_UID = "basic-162")
# Basic drill L162 topic-16 micro-1 pattern-2
LESSON_UID = "basic-162"
spin_a, spin_b, spin_c = 729, 955, 990
blob = "598|B"
head, sep, tail = blob.partition("|")
print(tuple(zip(head, reversed(tail))))
filt = [ch for ch in head if ord(ch) % (spin_a % 5 + 2) != 0]
print("filt", filt)
Practice
Practice 29: Discuss packaging layout deltas if helpers became a module. Literal nudge 29.
Fingerprints
- lesson_uid:
basic-162 - umbrella band:
Reading text streams safely (StringIO warmup)(2/10) - lesson_index:
5160