← Curriculum track ← Learn hub
Quanta GenAI Curriculum · Python · Intermediate

Python Intermediate — 026: Re-shape packaging hinges with observability hooks centred on `Custom iterators and iter() bridges` [329213]

Lesson 026: Custom iterators and iter() bridges

Focus

Treat the excerpt as executable notes: Intermediate drills Custom iterators and iter() bridges; spin token 237723 makes this page unlike its neighbours.

Key ideas

Example (LESSON_UID = "intermediate-026")

# Intermediate drill L026 topic-2 micro-5 pattern-7
LESSON_UID = "intermediate-026"
spin_a, spin_b, spin_c = 446, 617, 995

src = [((k + 26) * spin_a + 5) % 241 for k in range(4 + 5 % 3)]
derived = [v * v if v % 2 == 0 else v + spin_b for v in src]
print("src", src)
print("derived", derived)
print("zip_sum", sum(x + y for x, y in zip(src, derived)))

from pathlib import Path
import tempfile

with tempfile.TemporaryDirectory() as scratch:
    target = Path(scratch) / "scratch-26.txt"
    snap = [39, 494, 949, 413]
    target.write_text("\n".join(str(x) for x in snap), encoding="utf-8")
    print("scratch_bytes", target.stat().st_size, "rolling", sum(snap) % (995 + 131))

Practice

Practice 9: Freeze async sleep at zero vs tiny float; articulate scheduling impact. Literal nudge 9.

Fingerprints