Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
Spivak
on Nov 27, 2024
|
parent
|
context
|
favorite
| on:
Python type hints may not be not for me in practic...
Type hints alone don't do this, but you can use Pydantic to accomplish what you want. In Python type hints aren't enforced anywhere at runtime. They're for a type-checker to validate your source.
https://docs.pydantic.dev/latest/concepts/validation_decorat...
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search:
https://docs.pydantic.dev/latest/concepts/validation_decorat...