Speaker
Raymond Hettinger
Material
Note
- What are dataclasses for ?
- mutable data holder
- simplifying the process of writing the class
- Comparison with Named Tuples
- dataclass
- mutable
- unhashable
- more memory usage
- more efficient
- named tuple
- immutable
- hashable
- less memory usage
- less efficient
- dataclass
- Freezing and Ordering
@dataclass(order=True, frozen=True)
- Custom Field Specifications
field(default_factory=list)
field(hash=False)
field(repr=False)
field(compare=False)