Tag: dataclasses
-
__post_init__ vs __new__ vs __init__: When Order Matters
Learn when to use __post_init__, __new__, or __init__ in Python dataclasses and classesโmaster initialization order to prevent subtle bugs.
-
Pydantic 40x Validation Overhead: When Type Hints Break Performance
Pydantic validation adds 40x overhead to Python type checking. Discover when Pydantic hurts performance and how to optimize validation for speed.
-
Pydantic vs dataclass: 7x Slower Validation Overhead
Pydantic vs dataclass performance showdown: discover why runtime validation costs 7x speed and when to choose each for Python data handling.
-
dataclasses vs Pydantic vs attrs: Python Data Model Guide
dataclasses vs Pydantic vs attrs: real benchmarks, validation tradeoffs, and which to pick for production. Spoiler: speed isn't the deciding factor.