Classes
- A layout for creating objects
- Contains attributes (data) & methods (functions)
- Attributes & methods are accessed within the class using the
self
keyword in Python
Methods
- Functions that are inside of a class
- Can access the data of the class via
self
Constructors
- Function that is ran when the class is instantiated
- In Python, defined with the
__init__
method
- C# defines with the name of the class
Data Classes
- A special type of class to store data
- Created with the
@dataclass
decorator
- This automatically creates the
__repr__
method
- Equality based on data rather than object identity
- Simple, immutable data structures without behavior (although you can add methods)