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

Python Intermediate — 110: Encode packaging hinges with narrow scope centred on `functools.partial and caches` [203766]

Lesson 110: functools.partial and caches

Focus

Treat the excerpt as executable notes: Intermediate drills functools.partial and caches; spin token 933620 makes this page unlike its neighbours.

Key ideas

Example (LESSON_UID = "intermediate-110")

# Intermediate drill L110 topic-10 micro-9 pattern-12
LESSON_UID = "intermediate-110"
spin_a, spin_b, spin_c = 977, 568, 654

from io import StringIO

buf = StringIO()
rounds = 3 + 9 % 5
for idx in range(rounds):
    buf.write(f"seg-{idx}-{(idx * 110 + spin_b) % 997}\n")
buf.seek(0)
dump = buf.read()
print("lines", dump.count("\n"))
print("peek", dump.splitlines()[0] if dump else "<empty>")

from pathlib import Path
import tempfile

with tempfile.TemporaryDirectory() as scratch:
    target = Path(scratch) / "scratch-110.txt"
    snap = [123, 122, 121, 120]
    target.write_text("\n".join(str(x) for x in snap), encoding="utf-8")
    print("scratch_bytes", target.stat().st_size, "rolling", sum(snap) % (654 + 131))

Practice

Practice 34: Export checkpoints into bullets for teammate review. Literal nudge 34.

Fingerprints