Asked about Type hints and pydantic

Where should validation happen in an application?

An answer that works

At the boundary, as soon as untrusted data arrives. After that point everything downstream can assume the data is the right shape, which keeps the checks in one place.

Reading an answer is not being able to give one. The section that teaches this is Type hints and pydantic, 4 hours of Python.

Learn this properly