# Python Level 6: Object-Oriented Python

> Level 6: Object-Oriented Python of the LoWisa Python course: Classes and Objects, Inheritance, Composition and Protocols, Dataclasses and Domain Models. 3 lessons and 9 ideas, each explained in one line.

Object-Oriented Python is level 6 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.

## Classes and Objects

- **class and __init__.** A **class** is a blueprint; __init__ runs on each new instance and sets its attributes through self.
- **self.** **self** is the instance itself, passed automatically as the first parameter of every method.
- **Instance versus class attributes.** Attributes set on self belong to one instance; attributes on the **class** are shared by all of them.

## Inheritance, Composition and Protocols

- **Inheritance.** A subclass **extends** a parent, reusing behaviour and overriding what differs: super() reaches the parent’s version.
- **Composition.** **Composition** wires small objects together instead of subclassing: usually the more flexible design in Python.
- **Duck typing.** Python cares what an object can DO, not what it is: if it quacks, it passes: that is **duck** typing.

## Dataclasses and Domain Models

- **Dataclasses.** The **dataclass** decorator writes __init__, __repr__ and __eq__ for you from the field declarations alone.
- **Frozen dataclasses.** A **frozen** dataclass is immutable: attempts to reassign a field raise, making value objects trustworthy.
- **Modelling a domain.** Good models name the business: an Order with items and a total beats three loose **dicts** passed in parallel.

## Before and after this level

- **Before:** [Level 5: Modules & Packages](/courses/python/level-5-modules-and-packages/): Modules and Imports, Packages and Project Structure, Virtual Environments and Dependencies.
- **Next:** [Level 7: Errors & Debugging](/courses/python/level-7-errors-and-debugging/): Exceptions, Debugging and Tracebacks, Designing Reliable Failure Handling.

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 6: Object-Oriented Python cover?

Classes and Objects, Inheritance, Composition and Protocols, Dataclasses and Domain Models: 3 lessons and 9 ideas.

### What should I know before this level?

The level before it, Level 5: Modules & Packages, which covers Modules and Imports, Packages and Project Structure, Virtual Environments and Dependencies.

## 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-6-object-oriented-python/ · Updated 2026-11-16
