Also called: self, __init__, dataclass, object
In plain English
self is the object itself. @dataclass writes the boring constructor for you.
Example
Each listing is an instance of the Listing class with a name and a city.
In code
from dataclasses import dataclass
@dataclass
class Listing:
name: str
city: str
verified: bool = False
l = Listing("Warung Made", "Ubud")
Related terms
Added 2026-11-30 · Last reviewed 2026-11-30