What does the @dataclass decorator generate automatically?
- A __init__, __repr__ and __eq__
- B Only __init__
- C Database bindings
- D Type validation at runtime
Answer
__init__, __repr__ and __eq__
Dataclasses remove boilerplate for classes that mainly hold data. frozen=True additionally makes instances immutable and hashable.





