Skip to main content

565 docs tagged with "python"

View all tags

__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.

*args and **kwargs - Variable-Length Arguments in Python

Master Python's *args and **kwargs at engineering depth - how packing and unpacking work at the bytecode level, all 5 parameter types in order, forwarding patterns, decorator argument passing, and the anti-patterns that signal poor API design.

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.

Algorithmic Growth Visualizer

Build a growth visualizer to observe how algorithms scale with input size and develop deep intuition about performance and computational complexity.

API Versioning and Contracts

URL versioning, header versioning, contract testing with Pact, OpenAPI schema evolution, and backward compatibility strategies.

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 Performance Patterns

asyncio internals, event loop tuning, connection pooling, backpressure, and high-throughput async patterns for production Python services.

Async Synchronization Patterns

Implement bounded concurrency, rate limiting, and circuit breakers with asyncio locks, semaphores, events, conditions, and barriers.

Asyncio and Async/Await

Master Python's async/await model - coroutines, tasks, gather, event loop, async context managers, and building high-performance I/O-bound applications.

ATM Machine

Design a structured ATM simulation to apply computational thinking, state management, and flow control using Python fundamentals.

Behavioral Patterns

Chain of Responsibility, Command, Iterator, Mediator, Memento, Observer, State, Strategy, Template Method, and Visitor - behavioral patterns in idiomatic Python.

Binary Explorer

Build a structured binary exploration tool to understand bit representation, power-of-two logic, overflow behavior, and hardware-level thinking using Python fundamentals.

Binary Logic Playground

Build an interactive CLI playground to deeply understand binary representation, bitwise operators, masking, shifting, truth tables, and two’s complement in Python.

Bitwise Operators - The Systems Programmer's Toolkit

Master Python bitwise operators at engineering depth - binary representation, two's complement in arbitrary-precision integers, masking, bit flags, Unix permissions, XOR tricks, shift arithmetic, and real-world use in networking, cryptography, and the Python stdlib.

Bottleneck Optimizer

Take a deliberately slow codebase and systematically optimize it using profiling.

break-continue-and-loop-else

Deeply understand Python break, continue, and loop-else semantics to design deterministic loops, early-exit systems, safe iteration models, and production-grade control flow.

Build a Web Framework

Minimal ASGI framework with routing, middleware, dependency injection, and metaclass-based route registration.

Building an Async API Service

Apply asyncio in production - async FastAPI routes, background tasks, async database access, connection pools, and handling concurrency in a real API service.

Bytecode and the Compiler

How Python source becomes bytecode, the dis module, .pyc files, peephole optimisation, and writing a bytecode-level function.

Bytecode Inspection - Inside the code Object

Understand Python bytecode and the code object at engineering depth - all co_ attributes explained, how .pyc files work, reading bytecode with marshal, the line number table, closures in bytecode, and practical uses in debuggers and test frameworks.

Calling LLM APIs

Production patterns for calling LLM APIs - authentication, retry logic, rate limiting, error handling, async calls, and the Anthropic and OpenAI Python SDKs.

Capstone Overview

Five production-grade capstone projects that integrate metaprogramming, advanced typing, async patterns, performance engineering, architecture, and security.

Chess Move Validator

Design a rule-based chess move validator to strengthen logical thinking, coordinate reasoning, and structured conditional flow using Python fundamentals.

CLI Unit Convertor

Build a robust command-line unit converter that teaches parsing, structured data modeling, validation, floating-point precision handling, and defensive input engineering.

Closures - Functions That Remember Their Environment

Master Python closures at engineering depth - how inner functions capture free variables in cell objects, the classic loop-variable bug, nonlocal, function factories, closures as lightweight classes, and real-world patterns like memoization and event handler factories.

Code Coverage - Measuring What You Test (and What You Miss)

Master code coverage at engineering depth - line vs branch vs condition coverage, coverage.py internals with sys.settrace, pytest-cov, .coveragerc configuration, pragma no cover, coverage in CI, and mutation testing with mutmut to find tests that pass but don't catch bugs.

Comments vs Docstrings - Documentation as Executable Metadata

Master Python comments and docstrings at engineering depth - PEP 8 and PEP 257 conventions, Google/NumPy/Sphinx formats, the __doc__ attribute, inspect module introspection, type hints vs docstrings, documentation generation with Sphinx, and the pitfalls that make documentation worse than useless.

Computational Thinking - Module Overview

Master computational thinking before mastering Python. This module teaches how computers reason, how memory works, how programs execute, and how to think algorithmically - the engineering foundation that makes everything else possible.

Computational Thinking Projects

Develop structured problem-solving skills by applying computational thinking principles before writing full Python programs.

Control Flow Anti-Patterns - What Not to Do and Why

Master Python control flow anti-patterns - the arrow of doom, flag variables, exceptions for flow control, condition duplication, magic numbers, boolean parameter flags, redundant else, and more. Each with bad code, explanation, and clean refactored solution.

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.

CPython Architecture

The CPython source tree, the main evaluation loop, and how Python executes a .py file from disk to output.

CPython in Python 3.13

Free-threaded Python, the specialising adaptive interpreter, immortal objects, sub-interpreters, and what changed in the 3.10–3.13 internals.

Creational Patterns

Singleton, Factory Method, Abstract Factory, Builder, and Prototype - implemented idiomatically in Python for production systems.

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.

CSV Analytics Tool

Discover what programming truly means - beyond syntax - and build the engineering mindset required to master Python and computational systems.

CSV handling - reading and writing tabular data

Master Python's csv module at engineering depth - how csv.reader, csv.writer, csv.DictReader, and csv.DictWriter work, dialects and quoting modes, encoding issues with Excel BOM, sniffing unknown formats, streaming large files, and when to reach for pandas instead.

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.

Custom Sorting with Key - Sorting Complex Objects

Deep engineering-level exploration of Python's key= parameter for sorting - lambda functions, operator module, attrgetter/itemgetter, cmp_to_key, multi-criteria sorting, None handling, and production-grade ranking system patterns.

Cython and Native Extensions

Static typing in Python with Cython - turning Python bottlenecks into C-speed code without leaving the Python ecosystem.

Data Structure Selection Strategy - Engineering the Right Choice

Master the engineering decision framework for choosing Python data structures - complexity budgets, operation-frequency analysis, real-world case studies, space-time tradeoffs, and anti-pattern recognition. The capstone lesson of the data structures module.

Database Migrations with Alembic

Manage database schema changes safely using Alembic - auto-generated migrations, upgrade/downgrade, migration environments, and production deployment strategies.

Database Module Projects

Three production-style database engineering projects - a CRUD app with proper data layer, a transaction-safe service, and a full ORM-backed API.

Dataclasses - Code Generation, Immutability, and Production Patterns

Master Python's @dataclass decorator at engineering depth - what it generates, field() and default_factory, frozen=True for immutability, __post_init__ for validation, ClassVar vs InitVar, inheritance with dataclasses, ordering, and production patterns in FastAPI and config systems.

Decision Tree Validator

Build a structured decision-tree validation engine that detects unreachable branches, logical conflicts, missing defaults, and invalid rule paths using deterministic control flow design.

Decorators - Wrapping Callables at Engineering Depth

Master Python decorators at full engineering depth - functools.wraps, decorator factories with three-level nesting, class-based decorators, stacking order, production patterns (timing, retry, caching, rate limiting), and how FastAPI/Flask route decorators work under the hood.

Defensive Programming - Writing Code That Fails Gracefully

Learn defensive programming techniques for Python - guard clauses, fail-fast principles, input validation at boundaries, defensive copying, safe defaults, and patterns like null object and circuit breaker for production-grade resilience.

Dictionary Hashing Mechanism - How Python Dicts Work Internally

Master Python dictionary internals at the engineering level - CPython PyDictObject compact layout, open addressing with perturbation-based probing, hash computation, insertion-order guarantee, load factor and resizing, the hashability contract, hash randomization, and production patterns including dispatch tables, registry pattern, and memoization.

Digital Pet Simulator

Design a state-driven digital pet simulation to strengthen computational thinking, state transitions, and structured logic using Python fundamentals.

Directory Synchronisation

Discover what programming truly means - beyond syntax - and build the engineering mindset required to master Python and computational systems.

Disassembly with dis - Reading CPython Bytecode

Master Python bytecode disassembly with the dis module at engineering depth - reading disassembly output, key opcodes explained, value stack evolution, comparing equivalent Python patterns at the instruction level, and practical performance insights.

Distributed Tracing

OpenTelemetry, Jaeger, trace context propagation, custom spans, baggage, and sampling strategies for Python microservices.

Domain-Driven Design

Entities, Value Objects, Aggregates, Repositories, Domain Events, and Bounded Contexts - DDD in Python.

Environment variables - configuring Python applications at runtime

Master environment variables at engineering depth - how OS-level key-value pairs are inherited by child processes, how to read and set them with os.environ, the 12-factor app pattern, python-dotenv for development, type coercion pitfalls, and production-grade configuration with Pydantic Settings.

Error Tracking

Sentry integration, custom error grouping, breadcrumbs, release tracking, and building production error workflows in Python.

Error-Logging CLI Tool

Discover what programming truly means - beyond syntax - and build the engineering mindset required to master Python and computational systems.

Event-Driven Architecture

Message queues, pub/sub, event sourcing, CQRS, and saga patterns with Python, Kafka, and Redis Streams.

Everything Is an Object - The Core of Python's Runtime Model

A deep systems-level exploration of Python's object model, covering CPython internals, the PyObject struct, id/type/value trinity, first-class functions, metaclasses, attribute lookup chains, identity vs equality, and performance implications of Python's unified object system.

Exception Hierarchy - Python's Built-in Exception Tree

Master Python's complete built-in exception hierarchy - from BaseException at the root to StopIteration driving for loops, understand which exceptions to catch, when catching a parent catches all children, and how to pick the right exception to raise.

Exceptions Explained - Python's Error Handling Model

Understand Python exceptions at engineering depth - what an exception object is, how the call stack unwinds, exception chaining, the BaseException vs Exception split, and how to read production tracebacks from Django and FastAPI.

Execution Model in Practice - Source to Bytecode to PVM

How Python actually executes code - the complete 5-stage pipeline from source text through tokenization, AST, bytecode compilation, and the Python Virtual Machine. Covers stack frames, heap memory, .pyc files, import caching, LEGB scope, and the CPython GIL at engineering depth.

Expression Evaluator

Discover what programming truly means - beyond syntax - and build the engineering mindset required to master Python and computational systems.

FastAPI in Depth

Dependency injection, lifespan events, background tasks, middleware, custom exception handlers, OpenAPI customisation, and production FastAPI patterns.

Fault-Tolerant Calculator

Discover what programming truly means - beyond syntax - and build the engineering mindset required to master Python and computational systems.

File Backup Utility

Discover what programming truly means - beyond syntax - and build the engineering mindset required to master Python and computational systems.

File Descriptors and I/O

File descriptors, the VFS layer, O_flags, select/poll/epoll, io module internals, and zero-copy techniques.

Flask - Building REST APIs the Right Way

Master Flask at engineering depth - application factory pattern, request context proxies, routing, Blueprints, error handlers, testing with test_client, configuration management, and the extension ecosystem for building production-grade REST APIs.

Flowcharts - Seeing Logic Before Writing It

Learn to design algorithms visually using flowcharts. Model control flow, decision branches, and system behavior before touching code - and translate diagrams directly into clean Python.

FP Module Projects - Engineering Challenges

Three hands-on functional programming engineering projects for the Python Intermediate module. Build real systems using decorators, generators, closures, composition, and pure functions.

Frequency-Analyzer

Build a scalable frequency analysis engine using Counter, defaultdict, heap, and sliding window techniques to simulate real-world analytics systems.

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.

gRPC with Python

Protocol Buffers, gRPC service definitions, streaming, interceptors, and when to use gRPC over REST.

Health Checks and Readiness

Liveness vs readiness probes, dependency health checks, health check libraries, SLOs, and building production-grade health endpoints in Python.

Heap and Priority Queue - Efficient Minimum Tracking

Deep engineering-level exploration of binary heaps, Python's heapq module, min-heap and max-heap patterns, priority queues, top-K algorithms, heap invariants, Dijkstra's algorithm pattern, and real-world scheduling and streaming applications.

Hexagonal Architecture

Ports and Adapters - structuring Python applications so business logic is independent of frameworks, databases, and external services.

Higher-Order Functions - Functions as First-Class Citizens

Master Python higher-order functions at engineering depth - map, filter, reduce, functools.partial, lru_cache, function composition, and building your own pipelines. Learn when to use functional patterns and when to prefer comprehensions.

HTTP Deep Dive - What Actually Travels Over the Wire

Master HTTP/1.1 at the byte level - request/response wire format, method semantics, status code families, critical headers, connection pooling, the requests and httpx libraries, HTTP/2 multiplexing, and why every production client needs explicit timeouts.

Immutability Strategies - Tuples, Frozen Dataclasses, and Value Objects

Master Python's immutability toolkit at engineering depth - mutable vs immutable types, shallow vs deep immutability, namedtuple, frozen dataclasses, frozenset, MappingProxyType, and the replace/copy pattern for functional state updates. Covers DDD value objects and Redux-style state in Python.

Indexing and Query Optimization

Understand database indexes from the ground up - B-tree internals, query planning, EXPLAIN ANALYZE, composite indexes, and when indexes hurt performance.

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.

Interactive Calculator CLI

Build a production-grade interactive calculator CLI that teaches input handling, parsing, type conversion, operator semantics, truthiness, and safe evaluation without using eval.

Inventory-Management-Tool

Build a scalable inventory management system using dictionaries, sets, defaultdict, and Counter while applying engineering-level data structure decisions.

JAX and Functional ML

JAX jit, grad, vmap, pmap - functional transformations for high-performance ML, XLA compilation, and NumPy-compatible ML research.

JSON Serialization - Production-Grade Encoding and Decoding

Master JSON serialization in Python at engineering depth - custom encoders, datetime/Decimal/UUID handling, orjson and msgspec for high-throughput APIs, NDJSON streaming, content negotiation, and why float precision silently destroys financial data.

JWT Authentication

Master stateless JWT authentication - token structure, signing algorithms, refresh token rotation, common pitfalls, and building production-grade FastAPI JWT middleware.

Linting and Formatting - Ruff, Black, isort, and mypy

Master Python code quality tooling at engineering depth - Ruff's rule categories, Black's opinionated formatting, isort profiles, mypy static type checking, pyproject.toml configuration, and how to wire all tools into a coherent developer workflow.

Locks, Semaphores, and Synchronization

Master Python synchronization primitives - Lock, RLock, Semaphore, Event, Condition, and Barrier - and when to use each to build correct concurrent systems.

Log Parser Tool

Discover what programming truly means - beyond syntax - and build the engineering mindset required to master Python and computational systems.

Login Authentication Simulator

Build a state-driven authentication system using loops, guard clauses, decision trees, early exits, and deterministic control flow design.

Master Python Engineering

A structured, production-grade Python curriculum - from fundamentals to enterprise architecture. Built for engineers who want to understand how Python works, not just how to use it.

Math Utilities Library

Discover what programming truly means - beyond syntax - and build the engineering mindset required to master Python and computational systems.

Math Utilities Library

Discover what programming truly means - beyond syntax - and build the engineering mindset required to master Python and computational systems.

Matplotlib and Seaborn

Production-grade visualisation for ML - diagnostic plots, training curves, feature importance, distribution analysis, and publication-quality figures.

Memory Management Internals

CPython's memory allocator layers, the pymalloc arena system, reference counting, cyclic GC generations, and how memory is actually freed.

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.

Memory Profiling - tracemalloc, memory_profiler, objgraph, and pympler

Profile and debug Python memory usage at engineering depth - sys.getsizeof shallow vs deep size, tracemalloc snapshots and leak detection, memory_profiler line-by-line analysis, objgraph retention paths, pympler recursive sizing, and practical workflows for diagnosing real-world memory leaks.

Memory References and Aliasing - Python's Object Reference Model

Master Python's memory management at the engineering level - CPython reference counting (ob_refcnt), cyclic garbage collection, aliasing, weak references, del semantics, sys.getrefcount, memory leaks from closures and global caches, and real-world debugging strategies.

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.

Metrics with Prometheus

Prometheus client library, counter/gauge/histogram/summary, FastAPI instrumentation, custom metrics, alerting rules, and Grafana dashboards.

Middleware - Wrapping Every Request and Response

Master middleware at engineering depth - WSGI vs ASGI middleware, the onion model, request ID propagation, timing, structured logging, CORS, rate limiting with Redis, JWT authentication, and when to use middleware vs dependency injection.

Mini Rule Engine

Discover what programming truly means - beyond syntax - and build the engineering mindset required to master Python and computational systems.

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 01 - Object-Oriented Programming Overview

Master Python's object model at engineering depth - classes, instances, dunder methods, encapsulation, inheritance, MRO, composition, abstract base classes, dataclasses, SOLID principles, and production design patterns.

Module 02 - Core Python Syntax Overview

Master Python's core syntax at the engineering level - from installation and the REPL to the object model, type system, operators, and memory internals. The gateway module that separates programmers from engineers.

Module 02 - Functional Programming Overview

Master Python's functional programming model at engineering depth - lambdas, map/filter/reduce, generators, iterators, decorators, closures, pure functions, immutability, functools, and partial application and currying.

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 - Python Internals Overview

Understand CPython's implementation details at engineering depth - bytecode, the eval loop, the GIL, reference counting, garbage collection, memory profiling, sys/inspect, and the import system.

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 04 - Testing and Quality Overview

Build production-grade test suites at engineering depth - unittest, pytest, mocking, TDD, code coverage, linting, and pre-commit hooks that enforce quality at every commit.

Module 04 Projects - Testing and Quality

Overview of the two hands-on engineering projects for the Testing and Quality module - a full pytest suite for a banking system and a complete CI quality pipeline setup.

Module 06 - APIs and Web Basics

Master HTTP at the wire level, REST design principles, Flask, FastAPI, request/response lifecycle, middleware, JSON serialization, and Pydantic validation - the complete engineering foundation for building production web APIs in Python.

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.

Module 06 Projects - Overview

Two production-focused projects for Module 06 - a fully tested Task Management REST API with FastAPI and SQLAlchemy, and a local deployment stack with Docker, Nginx, PostgreSQL, and Alembic migrations.

Module 07 - Databases Overview

Master database engineering in Python - SQL, SQLite, PostgreSQL, transactions, indexing, SQLAlchemy ORM, and migrations.

Module 08 - Concurrency Overview

Master concurrency in Python - threading, multiprocessing, asyncio, event loops, race conditions, locks, and building production async systems.

MRO - Method Resolution Order and the C3 Linearisation Algorithm

Understand Python's Method Resolution Order at engineering depth - the diamond problem, C3 linearisation step by step, how super() traverses the MRO (not just "calls parent"), mixin patterns that depend on MRO, Django/Flask examples, and MRO failure cases.

Multiprocessing in Python

Bypass the GIL with multiprocessing - Process, Pool, shared memory, queues, pipes, and when to use processes instead of threads.

Mutable vs Immutable - Designing Reliable Data Structures

Master Python mutability at the engineering level - the object model (id, type, value), pass-by-object-reference, the mutable default argument anti-pattern, frozen dataclasses, += behavior differences, string concatenation performance, and designing reliable concurrent systems.

Nested-Logic-Patterns

Master nested conditional logic, execution path complexity, decision tree modeling, guard-clause refactoring, and deterministic control flow design in Python.

Numba JIT Compilation

LLVM-based JIT compilation for Python numerical code - GPU acceleration, parallel loops, and ufunc creation with @jit and @cuda.jit.

Number Pattern Analyzer

Design a structured number analysis system that reinforces state tracking, single-pass logic, pattern detection, and computational thinking.

NumPy Internals

NumPy memory layout, strides, broadcasting, vectorisation, and ufuncs - how NumPy achieves C-speed from Python.

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.

ORM with SQLAlchemy

Master SQLAlchemy - the declarative ORM, session management, relationships, lazy vs eager loading, and building production data access layers.

OS Primitives in Python

Processes, signals, environment, users, time, and the os/signal/resource modules - Python's interface to the POSIX operating system.

Overload and Type Narrowing

Use @overload for multiple function signatures and TypeGuard, TypeIs, assert_never, and pattern matching for exhaustive type narrowing in Python.

Overview

Apply control flow, decision tree modeling, branching logic, loop design, and rule-based systems to build deterministic and scalable execution architectures.

Overview

Apply Python’s runtime semantics, object model, dynamic typing, operator behavior, and memory concepts through engineering-grade projects.

Overview

Discover what programming truly means - beyond syntax - and build the engineering mindset required to master Python and computational systems.

Overview

Discover what programming truly means - beyond syntax - and build the engineering mindset required to master Python and computational systems.

Packaging and Environments - Module Overview

Master Python packaging and environments at full engineering depth - virtual environments, pip and lockfiles, pyproject.toml, Poetry, semantic versioning, and publishing to PyPI for production-grade projects.

Packaging Projects - Overview

Overview of hands-on projects for Module 05 - Packaging and Environments. Build, test, version, and publish a real Python utility package from scratch.

Pandas for ML

Pandas for machine learning - efficient data loading, feature engineering, pipelines, memory optimisation, and common ML preprocessing patterns.

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.

Partial Application and Currying - functools.partial, operator, and Function Pipelines

Master partial application and currying at engineering depth - functools.partial internals, inspecting partial objects, the distinction between partial application and currying, implementing currying in Python, the operator module as curried-style operations, function composition with reduce, and real-world usage in Django ORM, sorted(), and data pipelines.

pathlib - Modern Path Manipulation in Python

Master pathlib at engineering depth - learn why Path objects replace os.path strings, how the / operator composes paths, all path attributes and methods, globbing for batch processing, and cross-platform path handling with PurePath.

Pattern based Access Controller

Build a scalable, declarative permission engine using pattern matching, multi-dimensional branching, deterministic rule evaluation, and structured control flow architecture.

Pattern-Driven-Condition-Design

Master pattern-driven condition design, decision modeling, declarative control flow, rule mapping, and scalable branching systems in Python.

pip and requirements - Dependency Management in Practice

Master pip and requirements files at full engineering depth - dependency resolution, version specifiers, pip-tools lockfiles, layered requirements, hash verification, supply-chain security, and private package indexes for production workflows.

Plugin Framework

Build an auto-discovering plugin system using __init_subclass__, class registries, and import hooks.

PostgreSQL with Python

Connect Python to PostgreSQL using psycopg2 and psycopg3 - connection pooling, parameterized queries, JSONB, arrays, and production connection management.

Pre-Commit Hooks - Automate Quality Gates Before Every Commit

Master the pre-commit framework at engineering depth - Git hook mechanics, .pre-commit-config.yaml structure, building production hook pipelines with ruff, black, mypy, detect-secrets, and pytest, CI integration, team adoption strategy, and hook performance tuning.

Primitive Data Types - int, float, bool, and NoneType at Engineering Depth

A complete engineering exploration of Python's four scalar types - int, float, bool, and NoneType. Covers arbitrary precision integers, CPython small-int cache, IEEE-754 float layout, NaN gotchas, bool as int subclass, None as singleton, immutability, type promotion, and Decimal for financial arithmetic.

Priority-Task-Scheduler

Build a scalable priority-based task scheduler using heapq, deque, and advanced data structure reasoning to simulate real-world job queue systems.

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-Ready CLI Tool

Discover what programming truly means - beyond syntax - and build the engineering mindset required to master Python and computational systems.

Project 01 - Banking System Simulator

Build a banking system using Python OOP. Covers inheritance, @property validation, @classmethod factory methods, __repr__, overdraft protection, and transaction history.

Project 01 - Bytecode Visualizer

Build a Python bytecode analysis tool using the ast module, dis.get_instructions(), and CPython's value stack model. Parse source to AST, disassemble to bytecode, simulate stack evolution, and compare two implementations side by side.

Project 01 - Custom Decorator Library

Build a production-quality Python decorator library with retry, rate limiting, timeout, argument validation, and structured call logging. Covers closures, functools.wraps, inspect.signature, and decorator composition.

Project 01 - Full Test Suite for a Banking System

Build a production-quality pytest test suite for the BankAccount and SavingsAccount system - fixtures, parametrized edge cases, mocked external dependencies, integration tests, Hypothesis property-based tests, and 90% branch coverage enforcement.

Project 01 - Publish an Internal Utility Package

Build, test, version, and publish pyutils-engineersofai - a typed Python utility library with src/ layout, hatchling build backend, full pytest coverage, CHANGELOG, and GitLab CI pipeline that publishes on v* tags.

Project 01 - Task Management REST API

Build a production-quality Task Management REST API with FastAPI, Pydantic v2, SQLAlchemy, pytest TestClient, RFC 7807 error responses, request ID middleware, and Docker - full CRUD, pagination, filtering, and OpenAPI docs.

Project 02 - CI Quality Pipeline Setup

Configure a complete Python quality pipeline from scratch - pre-commit hooks, pyproject.toml tool configuration, GitLab CI four-stage pipeline, tox/nox multi-version testing, Makefile targets, coverage gate, and JUnit test report artifacts.

Project 02 - Lazy Evaluation Pipeline

Build a lazy data processing pipeline in Python that handles datasets larger than RAM. Covers generators, generator chaining, lazy evaluation, immutable pipeline objects, and streaming architecture.

Project 02 - Library Management System

Build a library management system using Python OOP. Covers __repr__, __eq__, __hash__, Abstract Base Classes, checkout systems with date tracking, overdue detection, and fine calculation.

Project 02 - Local Deployment Setup

Configure a production-like local deployment stack for the Task Management API - multi-stage Dockerfile, Docker Compose with Nginx and PostgreSQL, Alembic migrations, Pydantic BaseSettings, health checks, graceful shutdown, and a Makefile for operations.

Project 02 - Mini Profiler Tool

Build a production-quality Python profiler using sys.setprofile(), tracemalloc, and call tree construction. Supports context manager and decorator usage, formatted report tables, run comparison, and JSON export for CI integration.

Project 03 - Chess Engine (OOP Version)

Build a working chess engine in Python using ABCs, dunders, dataclasses, and composition. Covers Piece ABC, concrete piece classes, Board with __getitem__/__setitem__, Move dataclass, check detection, and algebraic notation.

Project 03 - Functional Data Processor

Build a functional-style data transformation system in Python using function composition, pipe, partial, singledispatch, and the Result monad pattern. All functions are pure; error handling avoids exceptions.

Project: Async Data Aggregation API

Build an async FastAPI service that aggregates data from multiple external APIs concurrently - with caching, rate limiting, circuit breaking, and background refresh.

Project: Concurrent Web Scraper

Build a production-grade concurrent web scraper using ThreadPoolExecutor and asyncio - rate limiting, retry logic, robots.txt compliance, and structured output.

Project: Library Management System

Build a command-line library management system backed by SQLite - books, members, loans, with proper SQL, transactions, and a clean data access layer.

Prompt Templates in Python

Building maintainable prompt systems in Python - template engines, versioning, testing prompts, few-shot construction, and prompt injection defense.

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.

Pseudocode - Design Before You Code

Learn to design algorithms using pseudocode before writing Python. Build structured thinking that prevents logic errors, guides clean implementation, and scales to complex real-world systems.

Publishing Packages - From Source to PyPI

Master Python package publishing at engineering depth - sdist vs wheel formats, build backends, TestPyPI workflow, twine and Poetry publishing, API tokens, private registries, and automated CI/CD release pipelines.

pyproject.toml - The Modern Python Project Standard

Master pyproject.toml at full engineering depth - PEP 517/518/621 build system specification, build backends, the full project table, optional dependencies, entry points, tool configuration, src layout, dynamic versioning, and building distribution artifacts.

pytest - The Industry-Standard Test Framework

Master pytest at full engineering depth - assertion rewriting via AST transformation, fixtures with scope, conftest.py, parametrize, monkeypatch, capsys, built-in marks, essential plugins, and pyproject.toml configuration for production test suites.

Python at Scale

Multiprocessing, Ray, Dask, and distributed Python - moving beyond a single CPU core for data processing and model training.

Python for Vector Search

Embeddings, vector databases, similarity search, RAG pipelines, and production vector search in Python with FAISS, Chroma, Pinecone, and pgvector.

Python if/elif/else - The Complete Deep Dive

Master Python conditional logic at the engineering level - evaluation order, truthy testing, ternary expressions, nested conditions, guard clause alternatives, and the real cost of deep nesting. Better than anything on W3Schools or GeeksforGeeks.

Python Memory Optimisation

Object memory overhead, __slots__, generators, memory-mapped files, and GC tuning - reducing Python's memory footprint in production.

Python Objects Under the Hood

PyObject layout, type objects, reference counting, small integer cache, string interning, and the cost of Python's dynamic type system.

PyTorch Fundamentals

PyTorch tensors, autograd, neural network modules, training loops, GPU acceleration, and production patterns for deep learning.

Race Conditions and Thread Safety

Understand race conditions at the CPU level - why they happen, how to detect them, and how to write thread-safe Python code that behaves correctly under concurrency.

Raising Exceptions - When and How to Signal Errors

Master the art of raising exceptions in Python - when to raise vs return, how to write good error messages, exception chaining, guard clauses, and how to design exception behavior for library code vs application code.

Recursion Fundamentals - Thinking in Self-Reference

Master Python recursion at engineering depth - base cases, recursive reduction, call stack mechanics, Python's recursion limit, classic algorithms, the dramatic performance difference between naive and memoized Fibonacci, and when recursion is the right tool.

Recursive File Explorer

Discover what programming truly means - beyond syntax - and build the engineering mindset required to master Python and computational systems.

Refactorign all previous projects

Discover what programming truly means - beyond syntax - and build the engineering mindset required to master Python and computational systems.

REST Principles - Designing APIs That Don't Break Clients

Master REST at engineering depth - Roy Fielding's six constraints, uniform interface, URL design, HTTP method semantics, status codes, pagination patterns, versioning strategies, RFC 7807 error format, and the Richardson Maturity Model.

Return Semantics - What Python Functions Actually Return

Master Python return semantics at engineering depth - how the RETURN_VALUE opcode works, why multiple return values are actually tuples, guard clauses, type-consistent returns, factory functions, and the Result pattern for error handling without exceptions.

Robust File Reader

Discover what programming truly means - beyond syntax - and build the engineering mindset required to master Python and computational systems.

Rule Based Discount Engine

Build a deterministic pricing engine using rule ordering, guard clauses, decision trees, and scalable branching architecture in Python.

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.

Scikit-Learn Pipelines

Scikit-learn Pipeline, ColumnTransformer, custom transformers, feature unions, and production-ready ML workflows.

SciPy for ML

SciPy for machine learning - optimisation, sparse matrices, statistical distributions, signal processing, and distance metrics.

Scope and LEGB - How Python Resolves Names

Master Python's scope resolution at engineering depth - the LEGB rule, how the compiler decides LOAD_FAST vs LOAD_GLOBAL at compile time, global and nonlocal keywords, and common scope bugs.

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.

Service Mesh Patterns

Circuit breakers, retries, bulkheads, timeouts, service discovery, and observability - resilience patterns for Python microservices.

Sets and Mathematical Operations - Hash-Based Membership Testing

Master Python sets at the engineering level - hash table internals without values, frozenset, O(1) membership testing vs O(n) list scan, union/intersection/difference/symmetric difference with Venn diagrams, performance benchmarking, deduplication patterns, and a 10M-line log analysis design challenge.

Shallow vs Deep Copy - Understanding Python's Memory Model

Master shallow and deep copy in Python at the engineering level - assignment aliasing, copy.copy() vs copy.deepcopy(), ASCII memory diagrams, the memo dict, circular references, custom __copy__/__deepcopy__ protocols, and production-ready patterns for defensive copying.

Shared Memory and IPC

POSIX shared memory, pipes, FIFOs, message queues, semaphores, and multiprocessing.shared_memory - Python inter-process communication.

Sockets and Networking

BSD socket API in Python, TCP/UDP from scratch, non-blocking sockets, Unix domain sockets, and building a minimal HTTP server.

SOLID Principles

Single Responsibility, Open/Closed, Liskov Substitution, Interface Segregation, and Dependency Inversion - applied to production Python.

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.

SQLite with Python

Use SQLite for development, testing, and embedded applications - the sqlite3 module, connection management, cursors, parameterized queries, and row factories.

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.

Streaming LLM Responses

Streaming LLM output in Python - server-sent events, async generators, FastAPI streaming endpoints, and building real-time chat UIs.

Strings Internals and Immutability - Engineering the Text Layer

Go beyond treating strings as simple text. Learn how CPython stores strings using PEP 393 flexible representation, why immutability is a deliberate design decision, how string interning works, and why naive concatenation in a loop silently destroys performance.

Structural Patterns

Adapter, Bridge, Composite, Decorator, Facade, Flyweight, and Proxy - structural design patterns in idiomatic Python.

Structured Concurrency with TaskGroup

Master asyncio.TaskGroup for safe concurrent execution, understand why gather() leaks tasks, handle ExceptionGroups, and implement the nursery pattern.

Structured Logging

Python logging module internals, structlog, JSON logs, correlation IDs, log levels, and log aggregation - from print() to production-grade structured logs.

sys and inspect - Runtime Introspection at Engineering Depth

Master the sys and inspect modules at engineering depth - sys.argv, sys.path, sys.modules cache, sys.settrace, sys._getframe, inspect.signature with all parameter kinds, inspect.getsource, inspect.stack, and how FastAPI, pytest, and click use these modules to build their core features.

The Event Loop Explained

Understand Python's asyncio event loop at engineering depth - how it works, selectors, callbacks, handles, and debugging event loop issues in production.

The GIL Explained

What the GIL is, why it exists, how it works in CPython 3.12+, its performance impact, and the Python 3.13 free-threaded mode.

The os module - system calls and process interaction

Master Python's os module at engineering depth - how it wraps POSIX and Win32 system calls, when to use os vs pathlib vs shutil, directory traversal with os.walk, file permissions, process IDs, environment variables, and why you should never use os.system.

Threading in Python

Master Python threading - Thread creation, daemon threads, thread lifecycle, sharing state, the GIL's real impact, and when threading actually helps performance.

Tool Use from Python

Building LLM tool use systems in Python -- function calling, tool schemas, execution loops, error handling, and multi-step agent patterns.

Traffic System Validator

Design a traffic light validation system to strengthen rule enforcement, state transitions, and structured conditional logic using Python fundamentals.

Transactions and Data Integrity

Master database transactions in Python - ACID properties, isolation levels, deadlocks, savepoints, and building transaction-safe data layers.

Tuples and Immutability - Engineering with Stable Data

Master Python tuple internals at the engineering level - CPython PyTupleObject layout, immutability vs constancy, hashability mechanics, named tuples, structural unpacking, and when to choose tuples over lists in production code.

Type Casting and Coercion - How Python Converts Types Internally

Understand Python's type conversion system at engineering depth. Learn how explicit casting calls dunder methods, where implicit coercion happens silently, how numeric promotion works, what truthiness really means, and the pitfalls that cause real production bugs.

Type Inspector Tool

Build an interactive CLI tool that inspects Python objects at runtime and reveals their type, identity, mutability, truthiness, and internal behavior.

Type System and Dynamic Typing - Engineering the Runtime Contract

A systems-level exploration of Python's type system covering static vs dynamic typing, strong vs weak typing, duck typing, runtime type checking, PEP 484 annotations, the typing module, mypy static analysis, type narrowing, and the engineering trade-offs of Python's gradual typing model.

unittest - The Standard Library Test Framework

Master Python's unittest framework at engineering depth - TestCase lifecycle, all assertion methods, assertRaises as context manager, setUp/tearDown/setUpClass, unittest.mock.patch, TestSuite, skip decorators, and subtests for parametrised testing.

venv and virtualenv - Python Environment Isolation

Master Python virtual environments at full engineering depth - how venv works at the filesystem level, PATH manipulation, pyvenv.cfg, pyenv for Python version management, and why Docker containers are not a substitute for virtual environments.

Writing Files

Discover what programming truly means - beyond syntax - and build the engineering mindset required to master Python and computational systems.

Writing Python C Extensions

The Python C API, writing and building a C extension module, PyArg_ParseTuple, error handling, reference counting in C, and CFFI/ctypes alternatives.