Python - Dataclasses
Dataclass Python dataclasses are a new feature introduced in Python 3.7 that allows users to define classes that are primarily used to store data. They are similar to namedtuples, but with some additional features that make them more powerful and flexible. eg. from dataclasses import dataclass @dataclass class SomeData : host : str user : str Python dataclasses are more powerful than namedtuples because they allow for mutable objects, inheritance, and default values. They are also easier to use than Pydantic because they do not require any additional library installation or configuration. Pydantic Pydantic is a third-party library that provides data validation and settings management using Python type annotations. It is built on top of Python's type hints, which makes it easy to define the structure of your data. Pydantic is designed to be fast and to consume minimal resources, making it suitable for use in large projects. eg. from pydantic import ...