__init_subclass__ - The Modern Alternative to Metaclasses
Master __init_subclass__ for subclass registration, definition-time validation, plugin registries, and keyword arguments in class statements - the Pythonic replacement for most metaclass use cases.
__set_name__ - The Descriptor Naming Protocol
Understand __set_name__, Python's descriptor self-naming protocol - how it eliminates name redundancy, how type.__new__ calls it, and how Django, Pydantic, and SQLAlchemy use it to build self-configuring field systems.
Advanced Event Loop
Master event loop internals including selectors, callbacks, timers, custom policies, uvloop, run_in_executor, and signal handling for production async systems.
Advanced Generic Patterns
Master Self type, TypeVarTuple, recursive types, generic protocols, and generic type aliases for framework-level type-safe design including builder patterns and tensor shape typing.
Async Context Managers
Master async resource management with __aenter__/__aexit__, asynccontextmanager, AsyncExitStack, and production patterns for connection pools and sessions.
Async Generators and Async Iterators
Build streaming data pipelines with async for, async yield, __aiter__/__anext__, async comprehensions, and finalization protocols for production async iteration.
Async Synchronization Patterns
Implement bounded concurrency, rate limiting, and circuit breakers with asyncio locks, semaphores, events, conditions, and barriers.
Async Web Scraper Pipeline
Build a rate-limited, fault-tolerant async scraper with backpressure.
Authenticated API with RBAC
Build a FastAPI app with JWT auth, role-based access control, password hashing, and security headers.
Bottleneck Optimizer
Take a deliberately slow codebase and systematically optimize it using profiling.
Build a CLI Development Framework
Extensible CLI framework with metaprogramming-based command discovery, plugin architecture, and type-safe argument parsing.
Build a Production API Platform
Full FastAPI application with clean architecture, JWT auth, RBAC, async database, caching, and profiling.
Build a Scalable Data Pipeline
Async data ingestion and transformation with backpressure, structured concurrency, and throughput profiling.
Build a Trading Signal System
Real-time data processing with async streams, performance-critical computation, and a type-safe event system.
Build a Web Framework
Minimal ASGI framework with routing, middleware, dependency injection, and metaclass-based route registration.
C Extensions and FFI - When Python Isn't Fast Enough
Master ctypes, cffi, Cython, and pybind11 for calling C/C++ from Python - loading shared libraries, writing CPython extensions, and accelerating hot paths with compiled code.
Caching Strategies - Trading Memory for Speed
Master functools.lru_cache, functools.cache, TTL caches, memoization patterns, cache invalidation, cachetools, Redis caching, and cache stampede prevention.
Capstone Overview
Five production-grade capstone projects that integrate metaprogramming, advanced typing, async patterns, performance engineering, architecture, and security.
Clean Architecture - Dependencies Point Inward
Implement Uncle Bob's Clean Architecture in Python with proper layering, the dependency rule, domain models, service layers, repositories, and framework boundaries.
Configuration Management - Environment-Driven Apps
Externalize and validate application configuration with python-dotenv, pydantic-settings, secrets management, multi-environment configs, and the 12-factor config principle.
cProfile and pstats - Function-Level Profiling
Master deterministic profiling with cProfile and pstats - reading profile output, sorting and filtering results, snakeviz visualization, profiling overhead, and real-world endpoint profiling.
Cryptographic Hashing
Master data hashing vs password hashing - hashlib, bcrypt, argon2, salting, timing attacks, constant-time comparison, and why MD5/SHA1 are broken for passwords.
Custom Awaitables
Build awaitable objects with the __await__ protocol, understand how coroutines and Futures work under the hood, and create custom async primitives.
Custom ORM Core
Build a mini SQLAlchemy-style ORM using metaclasses, descriptors, and __set_name__ to map Python classes to database tables.
Dependency Injection - Decoupling Components
Master dependency injection in Python from manual constructor injection to DI containers and FastAPI Depends, with testing strategies and architectural trade-offs.
Descriptors - The Protocol That Powers Python's Object Model
Master the descriptor protocol - __get__, __set__, __delete__, data vs non-data descriptors, the complete attribute lookup algorithm, and how property, classmethod, staticmethod, and bound methods work under the hood.
Dynamic Class Creation - Building Classes at Runtime
Master the type() three-argument form, the full class creation pipeline, code generation with exec and compile, namedtuple internals, __prepare__, and building DSLs that generate Python classes at runtime.
Generics and TypeVar
Master generic programming in Python with TypeVar, Generic base class, bound and constrained type variables, covariance vs contravariance vs invariance, and real-world patterns from FastAPI and SQLAlchemy.
Hexagonal Architecture (Ports and Adapters)
Implement Hexagonal Architecture in Python using Protocol-based ports, swappable adapters, and clear boundaries between application logic and external systems.
High-Performance Data Processor
Profile and optimize a data pipeline from 10x slower to baseline.
Import Hooks and the Import System - Intercepting Module Loading
Master Python's import machinery - sys.meta_path finders, loaders, ModuleSpec, lazy imports, AST transformation on import, circular imports, and importlib.metadata for plugin discovery.
Input Validation and Sanitization
Use Pydantic validators as security boundaries - prevent SQL injection, XSS, path traversal, SSRF, and file upload attacks through structural input validation in FastAPI.
JWT Authentication
Master stateless JWT authentication - token structure, signing algorithms, refresh token rotation, common pitfalls, and building production-grade FastAPI JWT middleware.
line_profiler and memory_profiler - Line-Level Analysis
Line-by-line time and memory profiling with line_profiler, memory_profiler, tracemalloc, and pympler - finding the exact lines that are slow or leak memory.
Memory Optimization - Fitting More in Less
Reduce Python memory usage with __slots__, weakref, array module, struct.pack, memory-mapped files, object pooling, and the flyweight pattern for processing millions of records.
Metaclasses - The Class of Classes
Understand type as the metaclass of all classes, the full class creation pipeline, __new__, __init__, __call__ on metaclasses, __prepare__, metaclass inheritance and conflicts, and real-world usage in Django, SQLAlchemy, and ABC.
Microservices vs Monolith - Making the Right Choice
Navigate the monolith-to-microservices spectrum with Python - bounded contexts, communication patterns, the modular monolith, and practical decision frameworks.
Modular Plugin System
Build an extensible CLI tool with plugin discovery, loading, and lifecycle management.
Module 01 - Metaprogramming Overview
Master the machinery that powers every serious Python framework - metaclasses, descriptors, __init_subclass__, __set_name__, dynamic class creation, and import hooks. Write code that writes code.
Module 02: Advanced Type System - Complete Overview
Master Python's type system at production depth - generics, Protocol, TypeVar, ParamSpec, overload, runtime checking, and static analysis with mypy and pyright. The module that turns type hints from annotations into engineering infrastructure.
Module 03 - Advanced Async & Concurrency Overview
Go beyond asyncio basics into async generators, structured concurrency with TaskGroup, custom awaitables, async context managers, and production-grade async architectures.
Module 04 - Performance Engineering Overview
Master Python performance from measurement to optimization - profiling strategy, caching, memory optimization, vectorization, and C extensions for building high-throughput systems.
Module 05: Architecture & Systems Design - Complete Overview
Design production Python systems with clean architecture, hexagonal architecture, dependency injection, plugin systems, 12-factor methodology, and configuration management. The engineering patterns that separate scripts from systems.
Module 06 - Security Engineering
Master security engineering in Python - cryptographic hashing, JWT authentication, OAuth 2.0, input validation, SQL injection prevention, secrets management, and secure coding patterns that protect production systems from real-world attacks.
OAuth 2.0 and OIDC
Implement OAuth 2.0 authorization code flow with PKCE, OpenID Connect ID tokens, Keycloak integration, and delegated authorization in FastAPI with authlib.
Overload and Type Narrowing
Use @overload for multiple function signatures and TypeGuard, TypeIs, assert_never, and pattern matching for exhaustive type narrowing in Python.
ParamSpec and Concatenate
Solve the decorator typing problem with ParamSpec and Concatenate -- preserve callable signatures through wrappers, type retry/logging decorators, and apply patterns from FastAPI middleware.
Plugin Framework
Build an auto-discovering plugin system using __init_subclass__, class registries, and import hooks.
Plugin Systems - Building Extensible Applications
Build extensible Python applications with entry_points, importlib.metadata, stevedore, __init_subclass__, and plugin lifecycle management.
Production Async Architecture
Build production-grade async systems with error handling strategies, graceful shutdown, health checks, backpressure, async testing with pytest-asyncio, and structured logging.
Production FastAPI Application
Build a FastAPI app with clean architecture, dependency injection, and proper configuration management.
Profiling Strategy - Measure Before You Optimize
Amdahl's law, the profiling workflow, identifying hotspots, benchmarking methodology with timeit, performance budgets, and the discipline of measuring before optimizing.
Project: Type-Safe Event System
Build a fully typed publish-subscribe system using generics, Protocol, and ParamSpec with compile-time event type safety.
Project: Typed Configuration Library
Build a configuration library with runtime validation using type hints, generic containers, and boundary-based validation.
Protocol and Structural Subtyping
Master typing.Protocol for structural subtyping in Python -- define interfaces based on behavior, compose protocols, make duck typing type-safe, and apply patterns from Django and file-like objects.
Python __init_subclass__ Practice Problems & Exercises
Solve 11 Python __init_subclass__ problems. Covers __init_subclass__ practice, subclass hook. Hints and solutions.
Python __set_name__ Practice Problems & Exercises
Solve 11 Python __set_name__ problems (3 Easy, 4 Medium, 4 Hard). Practice __set_name__ practice, descriptor naming with hints, runnable code, and solutions.
Python Advanced Event Loop Practice Problems & Exercises
Solve 11 Python advanced event loop problems. Covers event loop, asyncio event, run_in_executor python. Hints and solutions.
Python Advanced Generic Patterns Practice Problems & Exercises
Solve 11 Python advanced generic patterns problems. Covers advanced generic, recursive generics, generic mixin. Hints and solutions.
Python Async Context Managers Practice Problems & Exercises
Solve 11 Python async context managers problems. Covers async context, asynccontextmanager decorator. Hints and solutions.
Python Async Generators Practice Problems & Exercises
Solve 11 Python async generators and iterators problems. Covers async generators, async iterators, async for. Hints and solutions.
Python Async Synchronization Patterns: Practice Problems & Exercises
Solve 11 Python async synchronization patterns problems. Covers asyncio Lock, asyncio Semaphore, asyncio Event. Hints and solutions.
Python Build a CLI Development Framework: Practice Problems & Exercises
Solve 11 Python build a cli development framework problems. Covers cli framework, argparse design, plugin architecture. Hints and solutions.
Python Build a Production API Platform: Practice Problems & Exercises
Solve 11 Python build a production api platform problems. Covers production api, fastapi dependency, auth middleware. Hints and solutions.
Python Build a Scalable Data Pipeline: Practice Problems & Exercises
Solve 11 Python build a scalable data pipeline problems. Covers data pipeline, stream processing, pipeline design. Hints and solutions.
Python Build a Trading Signal System: Practice Problems & Exercises
Solve 11 Python build a trading signal system problems. Covers trading signal, financial data, signal computation. Hints and solutions.
Python Build a Web Framework Practice Problems & Exercises
Solve 11 Python build a web framework problems. Covers web framework, wsgi asgi, routing design, http request. Hints and solutions.
Python C Extensions and FFI Practice Problems & Exercises
Solve 11 Python c extensions and ffi problems. Covers ctypes practice, cffi exercises, C extensions. Hints and solutions.
Python Caching Strategies Practice Problems & Exercises
Solve 11 Python caching strategies problems. Covers lru_cache practice, functools.cache python. Hints and solutions.
Python Clean Architecture Practice Problems & Exercises
Solve 11 Python clean architecture problems (3 Easy, 4 Medium, 4 Hard). Practice dependency rule, domain model with hints, runnable code, and solutions.
Python Configuration Management Practice Problems & Exercises
Solve 11 Python configuration management problems. Covers pydantic settings, environment variables. Hints and solutions.
Python cProfile and pstats Practice Problems & Exercises
Solve 11 Python cprofile and pstats problems. Covers cProfile practice, pstats sorting, profiling decorator. Hints and solutions.
Python Cryptographic Hashing Practice Problems & Exercises
Solve 11 Python cryptographic hashing problems. Covers hashlib sha256, hmac digest, salted hashing. Hints and solutions.
Python Custom Awaitables Practice Problems & Exercises
Solve 11 Python custom awaitables problems. Covers __await__ protocol, coroutine internals, custom Future. Hints and solutions.
Python Dependency Injection Practice Problems & Exercises
Solve 11 Python dependency injection problems. Covers DI container, constructor injection, FastAPI dependency. Hints and solutions.
Python Descriptors Practice Problems & Exercises
Solve 11 Python descriptors problems (3 Easy, 4 Medium, 4 Hard). Practice descriptor practice, __get__ __set__ with hints, runnable code, and solutions.
Python Dynamic Class Creation Practice Problems & Exercises
Solve 11 Python dynamic class creation problems. Covers dynamic class, type() exercises, class factory. Hints and solutions.
Python Generics and TypeVar Practice Problems & Exercises
Solve 11 Python generics and typevar problems. Covers TypeVar practice, generics exercises, Generic class. Hints and solutions.
Python Hexagonal Architecture (Ports and Adapters): Practice Problems & Exercises
Solve 11 Python hexagonal architecture (ports and adapters) problems. Covers hexagonal architecture, ports and, protocol port. Hints and solutions.
Python Import Hooks Practice Problems & Exercises
Solve 11 Python import hooks problems. Covers sys.meta_path exercises, custom finder, import system. Hints and solutions.
Python Input Validation Practice Problems & Exercises
Solve 11 Python input validation and sanitization problems. Covers input validation, whitelist validation, regex input. Hints and solutions.
Python JWT Authentication Practice Problems & Exercises
Solve 11 Python jwt authentication problems (4 Easy, 4 Medium, 3 Hard). Practice JWT exercises, JSON web, JWT signing with hints, runnable code, and solutions.
Python Line Profiler Practice Problems & Exercises
Solve 11 Python line profiler and memory profiler problems. Covers line_profiler practice, memory_profiler python. Hints and solutions.
Python Memory Optimization Practice Problems & Exercises
Solve 11 Python memory optimization problems. Covers __slots__ python, generators memory, array module. Hints and solutions.
Python Metaclasses Practice Problems & Exercises
Solve 11 Python metaclasses problems. Covers metaclass practice, type() exercises, __new__ problems. Hints and solutions.
Python Microservices vs Monolith Practice Problems & Exercises
Solve 11 Python microservices vs monolith problems. Covers microservices vs, bounded context, modular monolith. Hints and solutions.
Python OAuth 2 and OIDC Practice Problems & Exercises
Solve 11 Python oauth 2 and oidc problems. Covers OAuth2 practice, OAuth2 authorization, PKCE python. Hints and solutions.
Python Overload Practice Problems & Exercises
Solve 11 Python overload and type narrowing problems. Covers overload practice, type narrowing, @overload problems. Hints and solutions.
Python ParamSpec and Concatenate Practice Problems & Exercises
Solve 11 Python paramspec and concatenate problems. Covers ParamSpec practice, Concatenate exercises. Hints and solutions.
Python Plugin Systems Practice Problems & Exercises
Solve 11 Python plugin systems problems (3 Easy, 4 Medium, 4 Hard). Practice plugin system, entry_points exercises with hints, runnable code, and solutions.
Python Production Async Architecture: Practice Problems & Exercises
Solve 11 Python production async architecture problems. Covers production async, graceful shutdown, async health. Hints and solutions.
Python Profiling Strategy Practice Problems & Exercises
Solve 11 Python profiling strategy coding problems (4 Easy, 4 Medium, 3 Hard). Covers timeit python, performance measurement. Full hints and solutions included.
Python Protocol Practice Problems & Exercises
Solve 11 Python protocol and structural subtyping problems. Covers Protocol practice, structural subtyping, duck typing. Hints and solutions.
Python Runtime Type Checking Practice Problems & Exercises
Solve 11 Python runtime type checking problems. Covers runtime type, isinstance exercises, runtime validation. Hints and solutions.
Python Secrets Management Practice Problems & Exercises
Solve 11 Python secrets management problems. Covers os.environ config, python-dotenv loading, vault secret. Hints and solutions.
Python Secure Coding Patterns Practice Problems & Exercises
Solve 11 Python secure coding patterns problems. Covers secure coding, least privilege, fail-safe defaults. Hints and solutions.
Python SQL Injection Prevention Practice Problems & Exercises
Solve 11 Python sql injection prevention problems. Covers SQL injection, parameterized queries, SQLAlchemy ORM. Hints and solutions.
Python Static Analysis in Practice: Practice Problems & Exercises
Solve 11 Python static analysis in practice problems. Covers static analysis, mypy exercises, pyright problems. Hints and solutions.
Python Structured Concurrency with TaskGroup: Practice Problems & Exercises
Solve 11 Python structured concurrency with taskgroup problems. Covers TaskGroup practice, asyncio structured, asyncio gather. Hints and solutions.
Python The 12-Factor App Practice Problems & Exercises
Solve 11 Python the 12-factor app problems (3 Easy, 4 Medium, 4 Hard). Practice 12-factor app, 12-factor methodology with hints, runnable code, and solutions.
Python Vectorization with NumPy Practice Problems & Exercises
Solve 11 Python vectorization with numpy problems. Covers numpy vectorization, numpy broadcasting, numpy ufunc. Hints and solutions.
Real-Time Data Stream Processor
Build an async pipeline processing multiple data streams with TaskGroup.
Runtime Type Checking
Validate data at system boundaries using get_type_hints, isinstance limitations, beartype, typeguard, and Pydantic's runtime validation model, and build a custom runtime validator.
Secrets Management
Manage secrets securely with python-dotenv, Pydantic SecretStr, AWS Secrets Manager, HashiCorp Vault, git-secrets, and production credential rotation strategies.
Secure Coding Patterns
Apply defense in depth, least privilege, CORS, rate limiting, CSP headers, dependency auditing with pip-audit, and static analysis with bandit to harden FastAPI applications.
Security Audit Tool
Build a CLI tool that scans Python projects for common security vulnerabilities.
SQL Injection Prevention
Prevent SQL injection through parameterized queries, SQLAlchemy best practices, ORM safety limits, raw SQL auditing, and defense against UNION, blind, and second-order injection.
Static Analysis in Practice
Configure mypy and pyright for strict mode, gradual typing adoption, type stubs, py.typed markers, CI integration, and strategies for migrating untyped codebases.
Structured Concurrency with TaskGroup
Master asyncio.TaskGroup for safe concurrent execution, understand why gather() leaks tasks, handle ExceptionGroups, and implement the nursery pattern.
The 12-Factor App - Building Deployable Python Apps
Apply the 12-Factor App methodology to Python applications with FastAPI, Docker, and PostgreSQL - covering all 12 factors with production-ready code examples.
Vectorization with NumPy - Escaping Python's Loop Overhead
Understand why Python loops are slow, how NumPy's C-level loops bypass interpreter overhead, broadcasting rules, views vs copies, memory layout, ufuncs, and real-world data pipeline optimization.