Architect

Level: Architect | 15 Labs | Docker: python:3.11-slim

Deep-dive into CPython internals, advanced concurrency, security hardening, and production platform engineering. Each lab is independently runnable via Docker.

Quick Start

docker run -it --rm python:3.11-slim bash
pip install fastapi uvicorn pydantic pluggy cryptography prometheus-client opentelemetry-sdk

Lab Index

#
Lab
Topics
Key Verification

01

PyObject, dis module, bytecode, frame objects, code objects, peephole optimizer

dis.dis() output on real function

02

MetaPathFinder, PathEntryFinder, custom Loader, sys.meta_path, import hooks, pkgutil

Custom importer loading synthetic module

03

__get__/__set__/__delete__, data vs non-data, property internals, __set_name__, slots, validation

Typed descriptor with validation

04

pymalloc arenas/pools/blocks, getsizeof, tracemalloc, gc module, weakref caches

tracemalloc top-5 allocators snapshot

05

CDLL, POINTER, Structure, Union, cast, libc qsort/malloc/free, CFUNCTYPE

ctypes calling libc qsort

06

Event loop, selectors, Future.await, Task scheduling, call_soon, async generators, contextvars

ContextVar request-scoped state demo

07

__prepare__, metaclass new/init/call, conflict resolution, init_subclass, singleton, ORM registry

ORM-like metaclass field tracking

08

GIL impact, multiprocessing.Pool, ProcessPoolExecutor, shared memory, mmap IPC, as_completed

GIL vs multiprocessing speedup benchmark

09

lru_cache internals, cache_info/clear, wrapped, TTL decorator, disk cache, numpy caching

lru_cache hits/misses + TTL expiry

10

typing.Protocol, runtime_checkable, Protocol.call, ParamSpec, TypeVarTuple, Concatenate, overload

mypy-compatible Protocol + isinstance

11

Redis-backed queue, task serialization, worker pool, exponential backoff, dead letter queue, result TTL

In-memory queue demo + Redis pattern

12

OpenTelemetry TracerProvider, SpanKind, attributes, baggage; Prometheus Counter/Histogram/Gauge; structlog

Real span capture + Prometheus metrics

13

pluggy hookspec/hookimpl, entry points, init_subclass registry, versioning, DI, sandboxing

pluggy hook call chain

14

secrets module, hmac.compare_digest, sha3_256/blake2b, cryptography Fernet + RSA + X25519, safe unpickling

Fernet encrypt/decrypt + RSA sign/verify

15

FastAPI + Pydantic v2 + import hook + descriptors + asyncio + tracemalloc + pluggy + Prometheus + Fernet + pytest

Full platform integration, 8+ tests

Available Packages (python:3.11-slim)

Package
Version

fastapi

0.135.1

numpy

2.4.2

pandas

3.0.1

pydantic

2.12.5

pytest

9.0.2

requests

2.32.5

uvicorn

0.41.0

rich

latest

anyio

latest

click

latest

Additional via pip install:

  • pluggy β€” Plugin framework

  • cryptography β€” Fernet, RSA, ECDH

  • opentelemetry-sdk β€” Distributed tracing

  • prometheus-client β€” Metrics

  • structlog β€” Structured logging

  • redis β€” Redis client (Lab 11)

Learning Path

Prerequisites

  • Python Intermediate or Advanced track completed

  • Familiarity with: classes, decorators, async/await, type hints

  • Docker installed for isolation

Running Any Lab

Last updated