§ 2.13section 13 of 20·~5 min
Week 2 plan, lab and assignment
Phase 0 · Foundations · ⏱ 12–15 hrs · 🆓 Free preview week
🧩 New weekly habit from this week: DSA + SQL track, 3 problems/week (~2 hrs).
Why this matters
LangChain, LangGraph, and FastAPI are all built on classes, type hints, and Pydantic models. You need to read and write this style of code fluently.
Learning objectives
- Write classes, dataclasses, and use inheritance and composition
- Add type hints everywhere and run a type checker
- Handle errors with
try/except/finallyand write custom exceptions - Read and write files and JSON; split code into modules and packages
- Write unit tests with
pytest
Day-by-day plan
Every day starts with reading. The written lessons teach everything; there are no videos.
| Day | Read | Topic | Activity |
|---|---|---|---|
| 1 | Lesson 2.1 | OOP | Classes, __init__, methods, @property, dunder methods (__repr__, __eq__) |
| 2 | Lessons 2.2–2.3 | Dataclasses & typing | @dataclass, list[str], dict[str, int], Optional, Literal, TypedDict (used heavily in LangGraph state!) |
| 3 | Lessons 2.4–2.5 | Errors & files | Exceptions, context managers (with), pathlib, json |
| 4 | Lesson 2.6 | Pythonic code | Comprehensions, generators, enumerate, zip, lambdas, decorators (intro) |
| 5 | Lessons 2.7–2.8 | Testing & quality | pytest, fixtures, assertions; ruff for linting |