franga2000 1 day ago

Please don't! Pydantic demands 100% type correctness at runtime in a language that can't guarantee basically anything at "compile" (lint) time. Screw up one type annotation for one edge case and your entire system turns into one big ValidationError.

Dataclasses let you return "incorrect" data and that's a good thing. I'd rather get an unexpected None here and there (which can be handled) than have library code crash because the wrong type snuck into a field I don't even care about.

As for support, is any explicit support needed? You can Pydantic models into things expecting dataclasses and often the other way around too.

1
worthless-trash 1 day ago

Spoken like a true dynamic types programmer. Some programmers prefer having errors over these surprises.