Skip to content

Reference: Classes and objects

Quick-lookup pages. Short, dense, and designed to skim — the sort of thing you keep a tab open on while you're writing a class. If you're here to learn the topic for the first time, start with Learn instead.

Pages in this section

  • Dunder methods catalogue — every dunder worth knowing, grouped by role: representation, comparison, arithmetic, container, iteration, context managers, attribute access, and callable.
  • @dataclass parameters — the full list of decorator and field() options: frozen, slots, eq, order, default_factory, and the rest.
  • property, classmethod, staticmethod syntax — the syntax for each decorator with its signature and common patterns.