aiengineering.guideaiengineering.guide

0 · Foundations › Phase 1 › Lesson 3 of 4

The Python you actually need

What this lesson covers

You do not need to master Python to build AI systems. You need a specific subset. This lesson names it, teaches what’s non-obvious about each part, and leaves the rest for when a real problem forces you to learn it.

The outline

  1. Dicts and lists, precisely. The two data structures that carry every model call — comprehensions, .get() defaults, and the shape mistakes that cost hours.
  2. requests and httpx. Making an HTTP call, timeouts (never omit), retries, connection reuse. Why requests is fine to learn on and httpx is what you’ll ship.
  3. Async in one hour. asyncio, await, asyncio.gather — the three ideas that unlock parallel model calls. Why sync code with a threadpool is almost always the wrong answer for LLM work.
  4. Dataclasses vs pydantic. When you want validation and when you want speed. How this maps directly to structured output later.
  5. Generators and streams. Why streaming responses are just Python generators, and why understanding yield will save you when a stream breaks.
  6. Typing, minimally. Type hints as documentation, not religion.

Coming soon

In outline.

Outline

Enter to go · Esc to close