Python · Section 3
Python Internals
What an object actually is underneath Python's syntax, how CPython allocates and frees memory, and what really happens when a function is called — important for senior-level debugging and design.
This section
- Object modelEvery value in Python is an object with an identity, a type, and attributes. What makes two objects the same object versus merely equal, whether an object can change in place, and what it means for an object to be usable as a dict key.3 core4 standard7 concepts
- Memory managementHow CPython allocates memory for an object, tracks how many references point at it, frees it — including the one case that needs a second mechanism — and the tools for referencing something without keeping it alive, reusing a value, or building an independent copy.3 core5 standard8 concepts
- Execution modelWhat actually happens when a function is called — the frame it runs in, the namespace it resolves names against, how a nested function keeps access to an enclosing variable, and why that lookup happens later than most people expect.2 core5 standard7 concepts

