python
Python for JS/TS developers
Learn Python coming from JavaScript — language core, scripting and automation, with an eye toward AI tooling.
Start track → 00
Start from zero
Why a JS/TS developer should add Python, and where it differs. 01
Language core
Syntax, the built-in data structures, and how typing differs from TS. 02
Scripting & I/O
Files, HTTP and packaging — enough to write a useful automation script. 03
The Python data model
Everything is an object with a protocol: dunders define behaviour, descriptors power attributes, and __slots__ is the memory lever. 01 Dunder protocols: __repr__, the eq/hash contract, truthiness, and NotImplemented 17 min 02 Attribute lookup and descriptors: why the instance dict does not always win 19 min 03 Classes, dataclasses, and __slots__: generated boilerplate and the per-instance dict 18 min 04 Iterators and generators: paused frames, lazy pipelines, and the file handle that never closed 19 min
04
Typing and the modern toolchain
Type hints are a static contract the runtime ignores: mypy/pyright enforce it, generics and protocols express it, uv and ruff ship it. 01 Type hints as a system: unions, TypedDict, Literal, and typing the boundaries first 17 min 02 Generics and Protocols: PEP 695 syntax, variance without hand-waving, structural typing 19 min 03 Type checkers in anger: narrowing, strictness, Any contagion, and mypy vs pyright 19 min 04 The 2025 toolchain: uv for environments and locking, ruff for lint and format, one pyproject.toml 17 min
05
Concurrency: GIL, threads, asyncio
The GIL serializes bytecode, not I/O: threads for waiting, processes for CPU, asyncio for many sockets — free-threading changes the rules. 01 The GIL, honestly: what it serializes, why refcounting needs it, and what 3.13 free-threading changes 18 min 02 Threads vs processes: choosing by workload, races under the GIL, and the fork+threads deadlock 18 min 03 asyncio honestly: suspendable frames, await as the only switch point, and the blocking call that freezes everyone 20 min 04 Structured concurrency: TaskGroup, except*, asyncio.timeout, and why bare create_task is a leak 20 min
06
Web services: ASGI and FastAPI
ASGI is the contract, FastAPI the ergonomics: pydantic validates at the boundary, sync handlers block the loop, lifespan owns resources. 01 ASGI and FastAPI: the scope/receive/send contract and the one blocking call that stalls a worker 18 min 02 Pydantic v2: parse at the boundary, trust inside — coercion, validators, and response_model filtering 18 min 03 The request lifecycle: middleware onion, dependency resolution, lifespan, and where errors surface 19 min
07
Testing with pytest
pytest is fixtures and assertions, not classes: parametrize kills copy-paste, fixtures are generators with teardown, hypothesis finds the cases you did not. 08
Performance: profiling and limits
Profile before touching code: cProfile lies under threads, py-spy samples production, memory has object overhead, and some jobs are not for Python. 01 Profiling with cProfile and py-spy: measure the production shape before touching code 18 min 02 Memory and objects: why an int costs 28 bytes and where the leak actually lives 18 min 03 C extensions, honestly: the options ladder, the GIL boundary, and the marshalling tax 18 min 04 When Python is the wrong tool: the decision tree and the salary-versus-servers arithmetic 16 min
09
Data work: pandas, polars, formats
DataFrames are pragmatic, not magic: pandas vs polars honestly, parquet over csv, pipelines that validate at every boundary. 01 pandas and Polars, pragmatically: columnar blocks, eager vs lazy, and the pitfalls that bite in production 18 min 02 File formats: CSV at the edges, Parquet inside — row groups, statistics, Arrow, and compression tradeoffs 17 min 03 Pipelines and validation: contracts at boundaries, idempotent writes, and the rows that silently vanish 19 min
10
Packaging and distribution
Imports are a runtime system: packages and sys.path mechanics, pyproject as the single source, lock files make installs reproducible. 11
Async internals
The event loop is a scheduler you can read: task stepping, cancellation as injected exception, timeouts as scoped cancel, sync bridges. 01 One loop iteration, dissected: ready queue, selector poll, timer heap, and which awaits actually yield 19 min 02 Cancellation semantics: an injected CancelledError, the bare-except immortality bug, and cleanup that must re-raise 18 min 03 Timeouts and shielding: scoped cancel with TimeoutError conversion, deadline propagation, and shield as half a tool 18 min 04 Bridging sync and async: to_thread and executors one way, a long-lived loop and run_coroutine_threadsafe the other 18 min
12
Python in production
Production Python is logging you can query, config that fails at boot, containers built right, and postmortems of leaks and hangs. 01 Logging and config: the dot-name logger tree, JSON output, and settings that fail at boot 19 min 02 Containerizing Python: slim plus multi-stage uv builds, cache-ordered layers, and signals that reach PID 1 18 min 03 Workers and lifecycle: gunicorn process math, preload and fork safety, graceful shutdown 19 min 04 Incident postmortems: the leak, the hang, the thundering restart — and the craft of blameless analysis 20 min
Build with this track
Guided projects that exercise what you learn here.
CI/CD pipelines
Ship safely on every push — pipelines, caching, and tests that gate a merge, with GitHub Actions.