Python基础 · free preview

Objects at the Next Level

Separate class state from instance state, guard attributes with properties, implement dunder methods, and cut boilerplate with dataclasses.

1. Overview

Overview

2. Class Attributes vs Instance Attributes

Class Attributes vs Instance Attributes

3. Guarding Values with Properties

Guarding Values with Properties

4. Dunder Methods

Dunder Methods

5. Dataclasses

Dataclasses

6. A Validated Temperature

A Validated Temperature

7. A Dataclass Inventory

A Dataclass Inventory

Practice this interactively

Free account · instant grading · spaced review that schedules itself.

Start this course for free