Comment

Comment by claytonjy

My general rule is, if I have a dict with a fixed set of keys, it should be a dataclass. Problem solved!

Then if I need to send or receive it, it's an easy conversion to a Pydantic BaseModel.

parent claytonjy 3 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton