3 ms·
When, if ever, do you use TypedDicts?
by mvieira38 1y ago
When, if ever, do you use TypedDicts?
- tiltowait 1y agoI use them for API responses/requests where dataclasses/pydantic don't add much value and introduce extra function calls and overhead. It's most common when part of the response from one API gets shuttled off to another. There's often no value in initializing a model object, but it's still handy to have some form of type-checking as you construct the next API call.