Why Defining __init__ Directly Is a Bad Practice and How to Replace It with dataclasses, classmethods, and NewType
The article explains that using a custom __init__ method to create data structures couples object construction with side‑effects, leading to fragile code, and demonstrates how refactoring with @dataclass, @classmethod factories and typing.NewType yields cleaner, safer, and more testable Python classes.