Pydantic: dataclass vs BaseModel
What are the advantages and disadvantages of using Pydantic's dataclass vs BaseModel? Are there any performance issues or is it easier to Pydantic's dataclass in the other python module?
ReadMeFeed / Community knowledge
Real questions. Useful conversations. Find the people who know your stack.
What are the advantages and disadvantages of using Pydantic's dataclass vs BaseModel? Are there any performance issues or is it easier to Pydantic's dataclass in the other python module?
I am trying to restrict one field in a class to an enum. However, when I try to get a dictionary out of class, it doesn't get converted to string. Instead it retains the enum. I checked pydantic documentation , but couldn't find anything relevant to my problem. This code is representative of what I actually need. from enum import Enum from pydantic import Ba