Re:Python type hints may not be not for me in practice
by never_inline on Thursday November 28, 2024 @11:38AM
(#42266621)
> for more complex data structures (think a json response from an api), dict (or typing.Dict) work fine
One of the reason I use typing is IDE completion and error highlighting. For that purpose - I make sure to annotate even the obvious primitive types and for API responses, I find that defining a Pydantic model works very well.
One of the reason I use typing is IDE completion and error highlighting. For that purpose - I make sure to annotate even the obvious primitive types and for API responses, I find that defining a Pydantic model works very well.