Articles tagged #python
-
Working with dates and times in Python: a practical guide
Python's `datetime` module ships with the standard library, costs nothing to install, and handles most of what you'll ever need. It also has a trap that bites almost every new developer within the first week: naive datetimes. This guide walks you through the full picture, from cr
-
Enforce API contracts at the boundary: Pydantic v2 validators done right
Your model looks tight. Fields are typed, validators are defined, and yet a string slips through an `int` field, or a required field raises "Field required" on a payload that definitely included it. These aren't edge cases. They're the default behavior of [Pydantic v2](https://py