# Python Level 14: Python Internals

> Level 14: Python Internals of the LoWisa Python course: Object Model and Data Model, Magic Methods and Descriptors, Interpreter and Garbage Collection. 3 lessons and 9 ideas, each explained in one line.

Python Internals is level 14 of 17 of the [LoWisa Python course](/courses/python/). It has 3 lessons and 9 ideas. Below is every lesson and what it teaches, in one line each.

## Object Model and Data Model

- **Everything is an object.** Numbers, functions, classes, modules: **everything** in Python is an object with a type and identity.
- **id, is and ==.** The **is** operator compares identity: same object: while == asks the objects whether they are equal in value.
- **Attributes and __dict__.** Most objects keep their attributes in a **__dict__**: attribute access is dictionary lookup wearing a dot.

## Magic Methods and Descriptors

- **Dunder methods.** Syntax is negotiated through **dunder** methods: + calls __add__, len() calls __len__, printing calls __repr__.
- **__repr__ honestly.** A good **__repr__** shows how to rebuild the object: debugging quality is set by this one method.
- **Descriptors.** A **descriptor** intercepts attribute access through __get__ and __set__: the machinery behind property and methods.

## Interpreter and Garbage Collection

- **Bytecode.** CPython compiles source to **bytecode** and a stack machine executes it: dis.dis shows the instructions.
- **Reference counting.** CPython frees an object the instant its **reference** count hits zero: deterministic and immediate.
- **The cycle collector.** Objects that reference each other in a **cycle** need the garbage collector’s periodic sweep to be freed.

## Before and after this level

- **Before:** [Level 13: Networking & Services](/courses/python/level-13-networking-and-services/): HTTP and APIs, Sockets and Network Programming, Building Reliable Service Code.
- **Next:** [Level 15: Performance](/courses/python/level-15-performance/): Profiling Python, Memory and CPU Optimisation, Native Extensions and Performance Boundaries.

In the app each of these ideas is taught and then asked back, and the level ends with a checkpoint and flashcards. See [Checkpoints and flashcards](/help/checkpoints-and-flashcards/).

## Frequently asked questions

### What does Python Level 14: Python Internals cover?

Object Model and Data Model, Magic Methods and Descriptors, Interpreter and Garbage Collection: 3 lessons and 9 ideas.

### What should I know before this level?

The level before it, Level 13: Networking & Services, which covers HTTP and APIs, Sockets and Network Programming, Building Reliable Service Code.

## Learn Python on your phone

The first level is free. LoWisa is on Google Play and the App Store.

---

Source: https://lowisa.dev/courses/python/level-14-python-internals/ · Updated 2026-11-16
