On this page
  1. Advanced Python Internals
  2. Overview
  3. Subtopics

Advanced Python Internals

Prev: Intermediate Python & Software Engineering | Up: tutorials | Next: Popular Application Domains
Rel: python3, python decorators, python metaprogramming, itertools, asyncio, gc, ctypes
Ref: docs.python.org — The Python Language Reference
Tags: #public #python3 #tutorials #internals #index


Overview

Runtime mechanics, lazy evaluation, metaprogramming, concurrency models, object model internals, memory management, and C interoperability using Python's built-ins and standard library.


Subtopics

  1. Iterators and Generators — The iterator protocol, lazy evaluation with yield and yield from, generator expressions, coroutines, and itertools pipelines.
  2. Decorators and Closures — Closures, lexical scope (nonlocal), function and class decorators, @functools.wraps, parameterized decorators, and stdlib decorator utilities.
  3. Concurrency and Parallelism — Asynchronous I/O (asyncio), multithreading (threading, queue), multiprocessing (multiprocessing), and concurrent.futures.
  4. Memory Management and Internals — Reference counting, cyclic garbage collection (gc), weak references (weakref), __slots__, tracemalloc, and bytecode disassembly (dis).
  5. Python Object, MRO & Initialization Dunder Flow — The object/type hierarchy, C3 linearization Method Resolution Order (__mro__, super()), and the complete dunder method execution flow triggered on class creation and object initialization.
  6. Foreign Function Interfaces — Calling C shared libraries with ctypes, C structs and callbacks, binary packing with struct, and zero-copy memoryview buffers.

Linked from

Related notes