Re:Python’s “type hints” are a bit of a disappointment to me
by john-radio on Friday April 22, 2022 @10:05AM
(#31121669)
I think the person you're responding to is just trying to be thorough in case it is helpful to someone else setting up python tooling; the only parts of what they wrote that are relevant to type checking are mypy and pydantic.
[ Parent
| on HN ]
Re:Python’s “type hints” are a bit of a disappointment to me
by rstuart4133 on Saturday April 23, 2022 @01:53AM
(#31131772)
And pydantic isn't really about type checking either. In fact it says that in the first few lines of the it's docs https://pydantic-docs.helpmanual.io/usage/models/ :
> pydantic is primarily a parsing library, not a validation library. Validation is a means to an end: building a model which conforms to the types and constraints provided.
Anyone whose used Typescript or even strong typed languages knew what to expect from Python + mypy. No surprises there. But pydantic's use of type hinting to create a remarkably dense serialisation library, and then fastapi's leveraging that to create REST interfaces along with automagic documentation generation - well that wasn't when I was thinking would happen when I saw the type hinting proposal.