Python trades raw control for speed of expression. Objects are heap-allocated and managed by reference counting backed by a cycle collector, values carry their types at runtime, and the reference interpreter runs Python bytecode behind a global lock. Its performance-critical parts, and its bridges to the rest of the system, are written in C through a stable C API, which makes Python as much a glue language over compiled code as a language in its own right. The scientific-Python and machine-learning stack, from NumPy to PyTorch, is the canonical example: a thin Python surface over compiled C, C++, and CUDA, which is much of why Python became the lingua franca of machine learning.

Python’s position in this section’s generics comparison is a third kind of erasure. Java erases for compatibility with pre-generic code, TypeScript erases because the runtime was never told about types at all, and Python keeps its annotations as live objects that no one enforces. list[int] is a real object built by a real method call at import time, and it means nothing to the interpreter. The whole generic system exists for a checker that runs before the program does, which makes the gap between what the checker proves and what the runtime does the most interesting thing in the folder.

The object model

Protocols rather than an inheritance tree. Most of the language is a consequence of these six.

Iteration, context, and the syntax built on protocols

Gradual typing, and the type parameter

Structural typing, where Python differs most

Describing what a plain parameter cannot

Where the checker stops and the runtime begins

The interpreter and its edges

Concurrency and failure

Read from the comparative layer


Any pages placed under this folder are auto-listed below by Quartz.

33 items under this folder.