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

Python Intermediate — 109: Budget executor etiquette with synthetic-but-finite data centred on `functools.partial and caches` [367905]

Lesson 109: functools.partial and caches

Focus

Let the literals expose mistaken assumptions quickly: Intermediate drills functools.partial and caches; spin token 942891 makes this page unlike its neighbours.

Key ideas

Example (LESSON_UID = "intermediate-109")

# Intermediate drill L109 topic-10 micro-8 pattern-9
LESSON_UID = "intermediate-109"
spin_a, spin_b, spin_c = 892, 976, 235

def helper(x, bias=6):
    return (x * bias + 8) % 5009

samples = [helper(109 + k) for k in range(3 + 10 % 4)]
print(samples, max(samples) - min(samples))

from pathlib import Path
import tempfile

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

Practice

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

Fingerprints