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.
CPython Architecture - The Interpreter at Engineering Depth
Understand CPython's architecture at engineering depth - the execution pipeline, the eval loop, PyObject memory layout, integer caching, string interning, the small object allocator, and alternative Python implementations.
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.
Garbage Collection - Generational GC, Cycle Detection, and Memory Leak Diagnosis
Master CPython's cyclic garbage collector at engineering depth - generational collection, three generations, cycle detection algorithm, gc module API, __del__ and PEP 442, gc.freeze() for fork, gc.get_referrers() for leak diagnosis, and common memory leak patterns.
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.
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.
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 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.
Python Bytecode Inspection Practice Problems & Exercises
Solve 11 Python bytecode inspection problems. Covers code object, co_code practice, co_consts exercises. Hints and solutions.
Python CPython Architecture Practice Problems & Exercises
Solve 11 Python cpython architecture problems. Covers eval loop, PyObject layout, integer caching. Hints and solutions.
Python Disassembly with dis Practice Problems & Exercises
Solve 11 Python disassembly with dis problems. Covers dis module, bytecode disassembly, opcodes practice. Hints and solutions.
Python Garbage Collection — Generational GC: Practice Problems & Exercises
Solve 11 Python garbage collection — generational gc and cycle detection problems. Covers garbage collection, gc module, cyclic garbage. Hints and solutions.
Python Internals Module Projects - Engineering Challenges
Two hands-on Python internals engineering projects for the Python Intermediate module. Build real tools using CPython's bytecode APIs, the dis module, AST inspection, tracemalloc, and sys.setprofile.
Python Memory Profiling — tracemalloc, sys.getsizeof,: Practice Problems & Exercises
Solve 11 Python memory profiling — tracemalloc, sys.getsizeof, objgraph, and pympler problems. Covers memory profiling, tracemalloc exercises, memory leak. H...
Python Reference Counting Practice Problems & Exercises
Solve 11 Python reference counting problems. Covers sys getrefcount, memory management, weakref exercises. Hints and solutions.
Python sys Practice Problems & Exercises
Solve 11 Python sys and inspect — runtime introspection problems. Covers sys module, inspect module, inspect.signature problems. Hints and solutions.
Python The GIL Explained Practice Problems & Exercises
Solve 11 Python the gil explained problems. Covers GIL practice, global interpreter, GIL threading. Hints and solutions.
Python The Python Import System —: Practice Problems & Exercises
Solve 11 Python the python import system — importlib, finders, loaders, and import hooks problems. Covers import system, importlib exercises, sys.modules cac...
Reference Counting - How CPython Manages Memory at the C Level
Master CPython's reference counting mechanism at engineering depth - ob_refcnt, sys.getrefcount, ctypes raw refcount access, tp_dealloc, reference cycles, weakref module, and why del x does not immediately destroy an object.
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 GIL Explained - What It Is, What It Isn't, and How to Work Around It
Master Python's Global Interpreter Lock at engineering depth - what the GIL protects, why counter += 1 is not atomic, the check interval, I/O vs CPU-bound threading, multiprocessing, C extensions that release the GIL, and Python 3.13 free-threaded mode.
The Python Import System - importlib, Finders, Loaders, and Import Hooks
Master the Python import system at engineering depth - sys.modules cache, import resolution order, finders and loaders, importlib.import_module, relative vs absolute imports, __init__.py, __all__, circular imports, custom import hooks, and importlib.reload.